arborist/aborist
russell@unturf.com f23d3a3067
qa: JSON-mode stop-sequence guards against post-brace token runaway
Bench data shows residual JSON-mode token runaway after the
pointer-ID switch: ~4 cases out of 66 land UNGROUNDED 0/0 at
12-15s instead of ~2-4s normal. Pattern: Hermes-3-8B emits a
valid claim object, then keeps generating whitespace / blank
lines until max_tokens (512) exhausts. The truncated payload
won't parse and the lenient pre-parser returns no claims.

Concrete instances in the latest bench (2026-04-30T19-55-11Z):
  - tell me about the apollo program (3/3 samples runaway)
  - tell me about the python programming language (1/3)

Fix: pass `stop=["\n\n"]` to the chat completion in JSON mode so
vLLM cuts generation at the first blank line. Well-formed JSON-
mode output never legitimately contains a blank line — Hermes
emits one object on a single line (or with simple internal
newlines), never `\n\n`. The stop sequence is the runaway
signature itself.

Plumbing:
  - OpenAICompatibleClient.chat_completion: new `stop` kwarg,
    injects into request payload when non-empty
  - StubClient already absorbs **kwargs; no change needed
  - DEFAULT_POLICY (runner) + DEFAULT_QUERY_POLICY (query) gain
    `claim_lattice_json_stop_sequences = ["\n\n"]`. Folds into
    governance_policy_hash so changing the stop list invalidates
    prior cached records.
  - Both call sites in runner.py / query.py read the policy
    field and pass it only on JSON mode (pointer + quote modes
    don't need it).

Defensive measure: worst case the stop sequence never fires;
best case the apollo/python residuals recover and JSON's
strict-rate climbs further.
2026-04-30 16:15:07 -04:00
..
distill storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
mesh mesh: per-peer audit chain-of-claims tracking on the wire 2026-04-28 19:41:25 -04:00
qa qa: JSON-mode stop-sequence guards against post-brace token runaway 2026-04-30 16:15:07 -04:00
search verify: layered strategies + entity policies, rename VISUAL → UNGROUNDED 2026-04-28 16:58:31 -04:00
sources crawler: skip feeds + sitemaps at ingest (they're discovery, not knowledge) 2026-04-29 05:55:28 -04:00
__init__.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
cli.py cli: surface answer_mode=claim_lattice on ask/query (JSON variant) 2026-04-30 12:37:49 -04:00
compress.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
document.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
evict.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
ingest.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
merkle.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
progress.py progress reporter + structured benchmark 2026-04-27 11:37:20 -04:00
snapshot.py add corpus-level snapshots: single-hash identity for the forest 2026-04-27 21:29:10 -04:00
source.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
store.py qa: G0 claim-lattice-pointer answer mode — CTI quote-by-pointer 2026-04-29 21:19:19 -04:00
wikitext.py verify: strip wikitext from context before substring matching 2026-04-28 15:48:07 -04:00