Repository navigation
Conversation
Independent review: PR #6 (composable exact chemistry search + generated Ruby importer SDK)Revision reviewed: base Checks actually run at head
|
| Check | Result |
|---|---|
cargo test --locked -p tantivy-rdkit -p quickwit-query (no native-chemistry) |
quickwit-query lib 168 ✓, tests/chemistry_operators.rs 3 ✓ (the native graph case is cfg-gated out), tantivy-rdkit composable.rs 7 ✓, scoring.rs 4 ✓ |
cargo test --locked -p quickwit-doc-mapper -p quickwit-search --lib -- tag_pruning timestamp chemistry narrow remove_redundant |
doc-mapper 30 ✓, search 17 ✓ (filtered subset). protoc had to be installed in the container. |
cargo test --locked -p quickwit-ingest --lib -- workbench router lost_replica |
35 ✓ (filtered subset) |
Ruby: bundle install (frozen, from Gemfile.lock) → JSON::VERSION=3.1.0 with JSON::Ext::Parser; generated gem built and installed from a copy |
wire_test.rb 20 runs / 392 assertions, 0 F; loaded_json_check_test.rb 9 / 10; examples/catalog_generation_test.rb 16 / 86; projection_test.py 7 ✓; every hash in provenance.json recomputed and matching |
python3 -m unittest resource harness |
9 ✓ |
python3 -m unittest scripts/ci/test_campaign_phase.py |
11 run, 2 F / 3 E on a host with any visible cargo/rustc; 11 ✓ under unshare --pid --fork --mount-proc (see M6) |
Not run: full-workspace Clippy/nextest, native-chemistry builds and tests (RDKit), REST/gRPC integration through a live server, Compose, Elasticsearch, any multi-node test. Nothing here is current-head runtime evidence.
JSON 3.1.0 evidence check. The json31-local logs show "json":"3.1.0" with the extension .so files loaded from the isolated GEM_HOME. The counts (20/392, 9/10, 16/86) match the PR body, and the reviewed file hashes match head. My independent run reproduces the same counts on Ruby 3.3.6 (the evidence used 3.3.8). Caveats:
- The evidence README says it ran on "f8c633d plus the fix", an uncommitted tree, and the logs record no git SHA.
- The "independent" and "pinned" reruns share seed 10109.
- The withdrawn 2.7.2 attribution is consistent:
catalog-recovery/tests.logshowsIgnoring json-3.1.0 because its extensions are not built. - Note B2 below: the tested JSON version is not what gem consumers get.
Summary of the query/search core (no confirmed defect)
I traced the Boolean, candidate and timestamp logic by hand and found it sound:
narrow_chemistry_candidates(quickwit-query/src/query_ast/chemistry_candidates.rs). Guards come only frommust/filterof the enclosing Bool and are truncated at scope exit. Pushing them into chemistry nodes undershould/must_notof the same Bool is sound, because no document failing a siblingmust/filtercan affect the outer result. The original candidates are kept inside afilterwrapper, soshouldrequirements survive. Cache state is reset, and the post-expansion serde depth check runs at the root.- ES
minimum_should_matchNoMatch →Some(should.len()+1). Validation stays eager and the compiler returnsmatch_noneafter building all children. Tag pruning, timestamp extraction and narrowing over such a Bool can only remove splits from a query that matches nothing. - Tag pruning. The
And(candidates, Uninformative)term correctly blocksNOT chem(NOT tag)from collapsing totag. - Timestamp pruning. Exclusive lower bounds now use
div_euclidwith no+1, and upper bounds use Euclidean rounding. Pre-epoch widening (lib.rstimestamp_start,list_relevant_splitspruning_end) only widens.CanSplitDoBetterswitches fromdiv_ceilto truncation, which matchesinto_timestamp_secs; this fixes a real pre-existing top-k drop of 1.x s hits in another split. Unknown bounds never prove a split uncompetitive.timestamp_literalavoids numeric unit inference for pre-1972 and extreme dates. - Physical schema deferral. Eager validation runs against the declared
chemistry_schema. Physical split validation happens only once a live, non-deleted candidate exists, and warmup is skipped for invalid physical fields. The test matrix covers 11 contracts × 3 operators × live/absent candidates.
Confirmed defects
B1 — Major: definite, pre-append rejections are now terminal "outcome unknown" 500s with no retry
- Where:
quickwit/quickwit-ingest/src/ingest_v2/workbench.rs:401-405mapsPersist(NoShardsAvailable | NodeUnavailable | Unspecified)toIngestFailureReason::Internal;:392mapsUnavailabletoInternal.:436-448(last_failure_is_transient,_ => false) makes all of these terminal. - Triggers that provably wrote nothing:
- The leader's per-shard rate limiter returns
NoShardsAvailablebefore any append (ingester.rs:544-558). - An ingester not accepting writes returns
NodeUnavailablefor every subrequest (ingester.rs:459-470), e.g. on decommission or before it is ready. - Transport connect failures.
- The leader's per-shard rate limiter returns
- Expected vs actual: before the PR these were retried within the 5 attempts on another shard or leader. Now the REST client gets 500
internal error, which the new OpenAPI (ingest_api/rest_handler.rs:146) describes as "outcome may be uncertain". On single-node Compose the leader rate limiter is local, so this hits Steven's bulk importer under ordinary burst load. A fail-closed importer stops; a retrying one is told the outcome is "unknown" when it is actually "not written". - Tests: two existing tests were changed to match the regression. In
router.rs,test_router_retry…was switched fromNoShardsAvailabletoCircuitBreaker, andtest_router_returns_rate_limited_failurebecametest_router_remote_no_shards_has_unknown_outcomeand now expectsInternal. - Smallest remedy: keep the leader's own pre-append
NoShardsAvailableand not-readyNodeUnavailableretryable. Map only replicate-path failures and missing acknowledgements to the ambiguous class. Better, add a distinct pre-appendPersistFailureReason. Add a router test where a rate-limited leader is followed by a healthy leader and assert success after retry.
B2 — Major (provenance / fail-closed): the gem does not constrain json; the tested 3.1.0 behaviour is not what consumers get
- Where:
sdk/ruby/generated/quickwit-cheminee.gemspec:31-33declares faraday, faraday-multipart and marcel only. Ruby 3.3 ships json 2.7.2 as a default gem. - Reproduced:
{"timed_out":true,"timed_out":false}parses tofalse(last key wins) on 2.7.2 but raisesParserErroron 3.1.0. Responses are parsed inapi_client.rb:278, so whetherExactSearchfails closed on a duplicate-key response depends on which JSON the host app resolves.- Binary-encoded but valid UTF-8 strings, typical of scraper HTTP bodies, are accepted by 2.7.2 and raise
GeneratorErroron 3.1.0 (exact_search.rb:71,catalog_generation.rb:43).
- Smallest remedy: add
s.add_runtime_dependency 'json', '>= 3.1', '< 4'via the gemspec template, or test the matrix explicitly. Add a duplicate-key response case towire_test.rb.
B3 — Major: a missing or relocated catalog journal silently becomes a fresh one, and every identity and sequence guard is lost
- Where:
sdk/ruby/examples/catalog_generation.rb:24-31creates the directory andscope.jsonwhen absent.:36and:62read a missingactive.jsonas revision 0 with emptyhigh_water.:64reads a missingidentities.jsonas{}.:219-222returnsnilfor missing files. - Trigger: the volume is not mounted, the path is wrong, or the directory was restored empty after a host loss.
- Reproduced (Ruby agent run): after moving the journal directory and reopening, all of these were accepted and promoted without error:
- a manifest reusing the already-consumed sequence 1,
- offer
o1re-keyed from record_id 1 to 77, - record_id 1 reused for a different offer.
- Expected vs actual: an existing deployment should fail closed when its journal is missing. Instead it is treated as a first run. This is the local-journal recovery path the PR's 16/86 tests cover, and they do not cover journal loss.
- Smallest remedy: split an explicit
init!from opening.openrequiresscope.json,identities.jsonandactive.json. Optionally refuse to init ifoffers-*generations already exist on the server.
B4 — Major: the Compose restart policy can hide a crash or OOM from the smoke and resource verdicts
- Where:
docker-compose.yml.example:24(restart: unless-stopped);distribution/cheminee-local/smoke.py:172-188,readiness.py:30-33,resource-measurements/run.py:28-31. - Trigger: Quickwit is OOM-killed at the 768m limit or crashes between requests or during the restart phase. Docker restarts it,
wait_readyabsorbs the gap, and the new cgroup resetsmemory.events/memory.peak. The finalOOMKilledcheck only describes the current incarnation. - Expected vs actual: the verdict should fail on any restart the smoke did not issue. In practice
RestartCountandStartedAtare never read. - Remedy: record
RestartCountandStartedAtat admission and at the end. Require the count unchanged andStartedAtto change only across the explicitdocker restart. Add a harness unit test for a 0→1 restart count.
M1 — Minor/Major: catalog example silently overwrites offer-level supplier and observed_at, and truncates time
- Where:
catalog_generation.rb:49(Time…utc.iso8601drops fractional seconds) and:54(offer.merge('supplier' =>…, 'observed_at' =>…)). - Reproduced: an offer carrying
supplier: 'Acme-EU-Reseller'and its ownobserved_atis stored with the snapshot's supplier and time.12:00:00.987Zbecomes12:00:00Z. Reseller provenance and dated availability (price-as-of) are lost without an error. - Remedy: reject conflicting keys, or store the snapshot time as
snapshot_observed_at. Useiso8601(9).
M2 — Minor: detailed_response=true can panic after a successful persist (existing code, newly documented)
- Where:
quickwit-serve/src/ingest_api/response.rs:94,String::from_utf8(doc.to_vec()).unwrap(). - Trigger: an NDJSON line with invalid UTF-8, common in scraped data, becomes a parse failure. The valid documents persist, then building the response panics. The client sees a dropped connection, which is ambiguous, so a retry duplicates the valid documents. This PR newly exposes
detailed_responsein the OpenAPI. - Remedy:
from_utf8_lossyor base64. Add a REST test with bodyb"\xff\n{}"anddetailed_response=true.
M3 — Minor: the campaign disk guard measures the path the operator names, not where Cargo writes
- Where:
quickwit/scripts/ci/campaign_phase.py:217, 274, 299(shutil.disk_usage(args.filesystem)), default/workspaceat:316. The measured path is not recorded in state (:223-230). - Trigger:
--filesystem /tmpwhiletarget/orCARGO_HOMEsits on a nearly full/workspace. Admission passes and the 640 MiB floor never trips. - Also:
growth_budget_mibis checked only at admission (:236).maximum_observed_drawdown_bytesis never compared with it, although the runbook describes it as a growth allowance. - Remedy: require
st_devof--filesystemto equalst_devof cwd, the resolved target dir andCARGO_HOME, asrun.py:101,115already does. Record the filesystem in state. Stop or flagexceeded_budgetwhen drawdown exceeds the budget.
M4 — Minor: lock/state crash window
- Where:
campaign_phase.py:231writes the new state path into the lock before the firstwrite_state(:250/:266). - Effect: dying in that window makes every later run hit
FileNotFoundErrorininspect_previous(:127-129). The reviewed-SHA escape can't apply to a file that doesn't exist, and the runbook forbids replacing the lock inode. - Remedy: write the state before updating the lock, or treat a missing prior file as an explicit review-required case.
M5 — Minor: stale or contradictory docs
sdk/ruby/README.md:17still says "Sixteen … tests / 319 assertions" (now 20/392).:240still calls the local pinned rerun "still-blocked", contradictingjson31-local.sdk/ruby/live_smoke.rb:6defaultsSDK_EXPECTED_VERSIONto0.9.1.pre.dsl, so it fails against the contract1 gem unless overridden.REMAINING_GATES.md:14,distribution/cheminee-local/README.md:3,89-90and rootREADME.md:8-10describe the native Compose smoke as passing or tested without saying it ran on an image built from8009925cwith older smoke scripts.INTEGRATOR_HANDOFF.mdandERROR_DOMAIN_REVIEW.mdattribute it correctly, so the docs contradict each other.distribution/cheminee-local/README.md:22-26packagestarget/debug/quickwitwithout saying the binary is unoptimized, so the 768m/2-CPU bounds describe a debug build.
M6 — Minor: test_campaign_phase.py is not hermetic
5 of 11 tests fail whenever any compiler process is visible in the PID namespace, because only one test patches unmanaged_builds(). Patch it in setUp and keep one dedicated detection test.
Risks (code-traced, not reproduced)
- R1 — Major (ingest, multi-node/replicated only): a timed-out or lost replica acknowledgement leaves the shard wedged.
- Where:
ingester.rs:675-683(the replicationErrbranch stillcontinues; "close and evict" is a TODO);ingester.rs:776-782(return Err(Internal("bad replica position"))for the whole PersistRequest); followerreplication.rs:580(if replication_position != from_position_exclusive { // TODO }). - Timeout scenario: the follower appends after the leader's timeout. The new code correctly reports the first batch as unknown, but the shard stays open with the leader behind the follower. On the next batch the follower appends regardless, the leader appends locally, sees the position mismatch, and returns
Internalfor the whole request. Data is in both WALs but the client gets 500, on every later batch. - Lost-ack scenario: the ack stream ends, so every later
replicatefailsCloseduntil the process restarts. - Scope: the logic is mostly pre-existing upstream, and the default single-node Compose (no replication) does not hit it. It still blocks any "fail closed and recoverable" claim for replicated deployments.
- Missing test:
lost_replica_ack_preserves_real_wal_and_reports_unknown_outcomestops after the first batch. Delay rather than drop the ack, send a second batch, and assert neitherErr(Internal)nor a success that wasn't reported.
- Where:
- R2 — Major: no REST error contract tells a client whether a retry is safe.
- 503 covers both router
NoShardsAvailable(not written) and routerTimeout(unknown). 500 coversSourceNotFound(error.rs:106), the definite cases in B1, and real ambiguity (Timeout→Internal("request timed out")). - The body is only
{"message"}, and no error schema is declared, so the generated gem can't branch on outcome. - No new HTTP-path test covers the new mappings, contrary to CLAUDE.md.
- Remedy: a machine-readable
outcome: not_persisted | unknownplus an error schema in the OpenAPI.
- 503 covers both router
- R3 — Major:
ExactSearchalways sorts_scorefirst (exact_search.rb:41).- BM25 statistics are per split, so for the documented scored
termexamples (MIGRATION.md:19,sdk/ruby/README.md:110), a background merge between page requests can reorder hits. Every page then validates, yet offers are duplicated or skipped across pages. - Tanimoto/graph scores are split-independent and
match_allaudits are unaffected. - Remedy: a
record_id-only ordering mode for enumeration, or wrap non-chemistry predicates inbool.filter.
- BM25 statistics are per split, so for the documented scored
- R4 — Major: an explicitly complete but empty scrape promotes and withdraws a supplier's whole catalog. The smoke asserts this at
catalog_generation_smoke.rb:167. There is no shrink-ratio or minimum-count guard with an explicit override. - R5: the raw ES
_searchpath claims more than it knows.relationis alwayseq(elasticsearch_api/rest_handler.rs:1218), including the defaultCountHits::Underestimate.timed_out:false,skipped:0andfailures:[]are hard-coded. With the defaultallow_partial_search_results=true, failed splits still return 200.ExactSearchdefends against all of this (strict mode,track_total_hits:true,_shardsarithmetic, record_id and page-length checks), so several of its checks can never fire against this server.- Callers of the unchecked generated method get none of that protection. The new
resp.errorscheck (:1177-1185) is dead, sinceSearchResponse.errorsis always empty inquickwit-search. - The new search OpenAPI declares only
post, while the route also accepts GET. It omits 408/429/503, and every body isObject.
- R6: the request-level
start_timestamp/end_timestampbound the query but not the chemistry candidate domain. They are applied as an outer filter (leaf.rsremove_redundant_timestamp_range) after root narrowing. A REST time window therefore does not stop verification of out-of-window candidates in the same split; an old-schema document outside the window can fail the query. Narrowing them in at the root would match the AST behaviour. ES and Ruby callers are not affected. - R7 (unmeasured): eager candidate verification allocates
Vec<(DocId, Score)>plus an ordinal cache per segment, proportional to live candidates (tantivy-rdkit/src/lib.rs:285,graph.rs:155). With no narrowing (defaultMatchAllcandidates), this is a full-segment pass on every query. No representative-corpus profile exists. - R8: chemistry identity is not tracked by the importer. The only structure check is non-empty SMILES. There is no canonical SMILES, RDKit/preparation version, or structure ID per offer, and nothing flags a SMILES change between generations. The example mapping has no native chemistry, so a promoted generation is not structure-searchable. This is documented.
- R9: Compose.
- There is no
memswap_limit, so on a host with swap the 768m bound can be masked. pids_limit: 256is below tokio's default 512 blocking threads, and the smoke never runs concurrent load.- Recreating with
down/upand WAL replay withoutcommit=wait_forare never exercised. Persistence paths do resolve correctly to the named volume.
- There is no
- R10: audit brittleness (
catalog_generation.rb:152-156, 194-197). Exact document equality will quarantine every generation if the server normalises floats, nulls, empty containers or dates, and a transient read error quarantines a good generation.
Unmeasured gates (agreeing with REMAINING_GATES.md, plus)
- Full-workspace CI (wrapped Clippy plus nextest with
--all-features) at head. - Native-chemistry tests at head.
- REST/gRPC integration at head.
prepare-ruby-sdk.ymlnever run in GitHub. It runs onlywire_testandprojection_test, not the catalog or loaded-JSON tests; it uses plainruby, notbundle exec; it does not diff regenerated output against the committedsdk/ruby/generated; and apt packages are unpinned. The JAR SHA-256, image digest and action SHAs are pinned.- SDK
server_revisionis8009925, 16 commits behind head, and no Ruby live smoke has run against a head server. - Current Compose runtime import/search/restart and resource measurements. The only live evidence is from the
8009925cimage. - Elasticsearch coexistence.
- Representative 100k-corpus recovery and stage profiling.
- Distributed promotion/CAS, durability, node/storage loss and HA. The 62/62 single-searcher SIGKILL result is not HA evidence.
- Record IDs above 2^53 live.
- ARM64 (not claimed, and
prepare_runtime.py:22enforces amd64). - Arbitrary Elasticsearch/Searchkick compatibility (not claimed).
sdk/ruby/generated/spec/**is empty rspec scaffolding (# assertion here). It is excluded from the gem and correctly not cited as evidence.
Judgments
- Ready for further draft review: yes. The query/search core is careful and well tested at the unit level, and the Ruby adapter's fail-closed checks are strong. B1–B4 are bounded, fixable issues with clear tests.
- Ready for release: no. Blocking items:
- B1: a regression in retry semantics that hits single-node bulk import.
- B2: the gem does not pin the JSON behaviour it was tested with.
- B3: the journal fails open on loss.
- B4: smoke/resource verdicts can hide OOM.
- R2: no machine-readable retry-safety contract.
- The gates above: no current-head CI, runtime, Compose or SDK-provenance evidence, and no replicated-ingest recovery (R1).
Generated by Claude Code
Description
Prepare exact composable chemistry queries and a generated Ruby importer client for supplier catalog search. The candidate adds explicit candidate-domain verification, split-schema and timestamp-boundary fixes, ingest acknowledgement handling, a fail-closed Ruby exact-search adapter, and local Compose/readiness/resource tooling. Catalog-generation examples distinguish acceptance, persistence, publication and searchable state; local journal tests do not establish distributed durability.
Stacked base:
cheminee/distributed-graph-searchat6bf1e29cdbf03409287b2f7d0e59a4c19534d8fa(open PR #3). The original unpublished chemistry history is preserved. Do not retarget main, which lacks these prerequisites.Dependency remediation updates compatible Rust/AWS/OpenDAL/Inferno packages, preserves per-operator verified TLS and profiling, updates generated Ruby to Faraday 2.14.3, and replaces vulnerable Python bootstrap vendors with hash-bound wheel installation. Narrow LRU panic-safety and separate mutable-borrow lifetime backports retain the existing Tantivy/Chitchat pins and dependency graph, without changing format or protocol code. Verified vendor provenance and separate registry-identity scans retain both original advisory rows: the historical October 19 database reported 9 raw and 11 identity-preserving matches (10 advisory IDs), with zero introduced. Fresh October 22 CI initially reported 14 matches, including newly introduced RUSTSEC-2026-0382. Commit
74489aaeprecisely updates rustls-webpki to 0.103.16 and roots/root-certs to 1.0.10; the same current RustSec database now reports 11 retained matches and zero introduced. The reviewed LRU defects are technically repaired; retained original-identity matches do not mean those defects remain in the patched source. The four-combination Chitchat UDP parent gate now passes; the disposable published-index reopen gate also passes; broader Quickwit compatibility remains open. This is not a clean full audit.Draft for independent review only. Merge, package publication, deployment and production-catalog changes remain held. No optimization benchmark trial has started.
Validation
Historical October 22 head:
92f70212, a documentation-only result/claim correction after executable headcacccfca928dd85e0d9914cd19c17cda341bdc27. New-head checks are separate; the results below belong tocacccfca.All four workflows passed: general CI, chemistry, DataFusion, and dependency review.
c774b166baseline andcacccfcacandidate, baseline write → candidate reopen/append → candidate restart → baseline reopen. The probe enforces embedded revisions, full source equality, counts, ordered pagination, selective/empty queries and clean shutdowns. This qualifies the disposable local-file published-index path; crash/WAL recovery and HA remain open.59ef7abf8ce56ea80fe7eba97ba3835449009fa4: 11 retained matches, zero introduced, after precise verifier/trust-store fixes. Full security admission remains open.Independent gpt-6-astra/max design, implementation and readiness reviews found no blocking source defect for these scoped checks. CI first exposed archive-only checkout before Git installation; the fix installs Git first and verifies exact checkout identity before native builds. Positive/wrong-head/archive-only controls passed.
Chemistry evidence artifact: SHA256
8af0ca1a89a3c5890c48e21865352d4d6380d25032a601cbf3dd37a2e5d2a1ee. Job logs and artifact metadata were inspected; direct workspace artifact download returned proxy 403 and was stopped. Archived JSON was not independently downloaded. Claim boundaries and the benchmark recovery inventory are inquickwit/scripts/ci/PR6_QUALIFICATION_2026-10-22.md.Local retained checks also include LRU panic/lifetime tests, 28 audit-policy tests and a same-binary HTTP rehearsal; they are supporting evidence, not substitutes for the completed revision-pair CI.
Additional scoped local evidence:
Earlier recorded evidence includes 39 old-schema HTTP cases, 18 timestamp-boundary HTTP cases, scoped exact-search Ruby/native checks, local journal/process recovery tests and a bounded searcher-loss probe. These remain attributed to their recorded revisions and do not establish HA or storage-loss durability. Historical benchmark comparisons are not current-candidate performance results.
Open gates
docs/cheminee-campaign/DEPENDENCY_PREFLIGHT.mdand its hash-bound evidence record.The full stacked diff retains generated SDK/evidence whitespace findings; clean incremental diffs do not mean the full PR diff is whitespace-clean. No runtime images, indexes or archives are added by this remediation.
Reviewer map
quickwit/quickwit-query/src/query_ast/,elastic_query_dsl/bool_query.rs,tests/chemistry_operators.rs.quickwit/tantivy-rdkit/src/,quickwit/quickwit-doc-mapper/src/query_builder.rs,quickwit/quickwit-search/src/{leaf,root}.rs.quickwit/quickwit-ingest/src/ingest_v2/,quickwit/quickwit-serve/src/ingest_api/.sdk/ruby/,quickwit/quickwit-serve/examples/export_openapi.rs,.github/workflows/prepare-ruby-sdk.yml. Generated spec scaffolding is not executed contract proof.quickwit-storage/src/opendal_storage/,quickwit-serve/src/developer_api/flamegraph.rs,quickwit/scripts/ci/python_test_env.py, and CI workflows.docker-compose.yml.example,distribution/cheminee-local/,docs/cheminee-campaign/,quickwit/scripts/ci/CAMPAIGN_RUNBOOK.md. Use the existing Kerberos compatibility wrapper for relevant workspace checks.