Repository navigation
fix(autoindex,api): complete the zero-experience naive path (#1102 #1103 #1104 #1105) - #1107
Merged
Merged
Conversation
…de recipe, success guidance, and a gain that tells the truth The rc.80 zero-experience E2E (AGENT_FTX_HARNESS, PR #1106) walked the shipped installer from install to "measure impact" as a first-time user and filed four defects. This fixes all four; each was reproduced verbatim before the fix and re-verified after it. #1102 — autoindex's first contact printed ping's raw context ("endpoint unreachable ... Connection refused") and taught a first-time user nothing. autoindex is the onboarding verb, so the no-node case now prints the same recipe `xerj def` has: start a node, or aim --url/$XERJ_URL at one. (lib.rs, Es::ping call site) #1103 — two success printers existed: the interactive summary taught the data map, the search shape and the _passage projection, while the generated-run (--no-graph / brain) printer stopped at "generation N committed" — and --no-graph is exactly the recovery the journal guard recommends, so users were steered onto the hint-less path. The code-aware hint text moved into one shared code_search_hint() and the generated-run printer now calls next_hint() + it too (gated on the committed run doc's code_files_indexed, the plan not being in scope on that resume/watch path). Before: bare one-liner. After: same guidance the graph path prints, verified on a fresh --no-graph run. #1104 — xerj gain probed XERJ_URL and ES-port+1 for the native listener, but a default node puts native REST on 8080 (the banner says so), so gain was unusable without hand-guessing the port. Probe order is now: given URL, host:8080 (default native), then the +1 convention, deduplicated; the error lists every URL tried. Verified: bare `xerj gain` on a default-ports node reads the audit log first try. #1105 — gain reported "283 searches, 3.0% found something, 275 zero-hit" after a session where every real search hit. The audit log mixed machine traffic into op=search: autoindex's read-back verification issues size:0 searches (~2/group; 179 in the harness window) and reconcile sweeps full-page searches against autoindex-catalog. Three parts: - the search audit note now carries the requested page size (took=4ms hits=0 size=0); additive, and gain treats a missing size= as a user search so pre-existing logs still parse. - gain separates the window into user searches vs counting probes vs catalog sweeps, reports the user's stats, and names what was excluded (nothing thrown away — it is all still in the audit log). - Es::count() uses the real _count endpoint first (audited count.post), keeping the size:0 search only as the old-build fallback. After, the same shape of session reports 4 user searches (2 hits, 2 honest misses) with 274 machine searches counted aside. Gates: xerj-autoindex --lib 1155 passed / 0 failed; ES-YAML conformance on a private port 1380 passed / 0 failed / 3 skipped. Files: - engine/crates/xerj-api/src/es_compat.rs — search audit note + size - engine/crates/xerj-autoindex/src/gain.rs — SearchWindow, note parser, native_candidates, output, tests - engine/crates/xerj-autoindex/src/esclient.rs — count() via _count - engine/crates/xerj-autoindex/src/lib.rs — ping recipe, shared code_search_hint, generated-run guidance
…obe (CI deny-warnings)
This was referenced Oct 1, 2026
This was referenced Oct 1, 2026
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 4, 2026
Version bump rc.80 -> rc.81 (17 workspace crates in Cargo.lock). CHANGELOG section cites every window PR: xerj-org#1106 xerj-org#1107 xerj-org#1112 xerj-org#1113 xerj-org#1114 xerj-org#1115 xerj-org#1116 xerj-org#1117 xerj-org#1119 xerj-org#1123 xerj-org#1124. ROADMAP rolled: shortlist re-verified live at cut (four open xerj-org#1091 xerj-org#1092 xerj-org#1094 xerj-org#1100; xerj-org#1093 closed by xerj-org#1112 inside the window and moves to the CHANGELOG). Landing stamp sweep RC.80 -> RC.81 in 54 files — footer stamps only; historical prose ('since rc.80', 'rc.80 closed that', PR xerj-org#1082 claims in llms.txt/llms-full.txt and the S3/alerting answers pages) deliberately left at rc.80.
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 10, 2026
xerj-org#1109) Problem: audit search entries recorded WHO issued a query (subject) but not WHO IT SERVED. The only machine/user separation available was the client-side heuristic in `xerj gain` (xerj-org#1105): parse `size=0` out of the note string, match resource == "autoindex-catalog". That is re-derivation of a classification the server already knew at append time, breakable by any note-format change, and spoofable by anything that can write audit-shaped entries (a client-set marker was proposed as `X-Xerj-Internal` during xerj-org#1107 and rejected as spoofable; that decision stands and this is the replacement). Fix: every AuditEntry now carries `actor: "user"|"machine"`, derived at append time by the SERVER alone, from the request's own semantics: machine iff size == 0 (a counting probe: asks for no hits back) or the target is the autoindex catalog (a maintenance index no person searches) `search_actor_class(size, index)` in es_compat.rs is the single derivation, deliberately a function of nothing a client can set. The search handler calls the new `audit.append_as(actor, ...)`; every other call site keeps `append()`, whose default is "user" — the writes and security ops are all request-driven user traffic. Tamper-evidence: actor is in compute_hash's input, so flipping an entry user->machine (the dodge that would remove unfavourable traffic from the gain hit-rate denominator) breaks the chain like any other edit. Mixed-version logs: serde `default = "default_actor"` loads fieldless pre-xerj-org#1109 entries as "user" — which is what they all were — and the hash recomputes over that deserialized default, so a log spanning the upgrade still verifies (pinned by test: hand-strip the field from one line of a persisted log, reopen, verify ok, keep appending). Consumer: `xerj gain` (xerj-autoindex/gain.rs) prefers the field when present and keeps the note/resource derivation ONLY as the legacy fallback for entries written by older binaries — an upgraded install whose ring still holds pre-xerj-org#1109 entries must not report a hit-rate dip that is really version skew. The probe/sweep counters keep their split inside machine traffic for the existing honesty line. The catalog index name moved to xerj-common::AUTOINDEX_CATALOG_INDEX (single source of truth) because the classifier (xerj-api) and the name's owner (xerj-autoindex::catalog) do not share a dependency edge; both now read the constant. Tests: 735/1256/337 lib tests green in xerj-engine/xerj-autoindex/ xerj-api; new pins — actor flip breaks the chain; mixed-version log verifies; actor field authoritative over note heuristics; catalog-named DATA index ("autoindex-catalog-copy") stays user; clippy clean.
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.
What
Fixes the four defects the rc.80 zero-experience E2E filed against the naive
path — the exact four stalls a first-time user hit going from install to
"measure what XERJ did for me":
autoindexwith no node running now prints the recipe(
xerj --insecure --data-dir ./.xerj-data &, or--url/$XERJ_URL),the same shape
xerj defalready printed, instead of a bareendpoint unreachable ... Connection refused.--no-graph/generated-run success printer now printsthe
next:hint and (when code was indexed) the code-aware_passagecurl hint. The code-hint text moved into one shared
code_search_hint()used by BOTH success printers, so the two paths cannot drift apart again.
xerj gainnow probes the native listener at the default8080 (then the ES-port+1 convention) instead of only port+1, so it
works on a default node without hand-guessing the port; the error lists
every URL tried.
(
took=4ms hits=0 size=0), andgainseparates machine traffic from theuser's: size-0 counting probes (autoindex's read-back verification, 179
of 283 "searches" in the harness window) and
autoindex-catalogreconcile sweeps are counted aside with an honesty line instead of
dragging the hit rate to 3% after a flawless onboarding.
Es::count()also uses the real
_countendpoint first (auditedcount.post), keepingthe size-0 search only as the old-build fallback.
Measured
Re-run of the harness on the built binaries (fresh node, same 90-file
corpus):
xerj gainwith no XERJ_URL override now reads the audit log onthe first try (8080 probe) and reports the user's real searches — 3/3 with
hits — with the machine traffic named separately. The
--no-graphrunends with the same
next:+ code hint the graph run prints. Autoindexagainst a dead port prints the start-a-node recipe.
Token A/B from the same harness (unchanged by this PR, for context):
152.7× context reduction vs reading whole files (926,492 → 6,066 tok over
5 questions), 34.2× vs reading just the top hit's file.
Notes
s 8000 ize=appended);gaintreats amissing
size=as a user search, so pre-existing logs still parse.search_all/GET share the one search audit site; no other note writerspin the old format (engine audit doc comment + gain fixtures updated).