PageIndex/pageindex
mountain ccc8b43bb7 fix: align merged hardening with dev's robustness and content fidelity
The prompt-injection hardening ported from main did not fit dev's direction
(graceful degradation + content-faithful, reasoning-based index). Adjust it:

- process_toc_no_page_numbers: a count-mismatched or reordered/renamed LLM
  response no longer raises ValueError (which aborted the entire index at the
  uncaught top-level path and defeated the return_exceptions degradation the
  rest of the pipeline uses). Skip the untrusted chunk and continue; the
  accuracy check falls back to another mode when too little gets filled.
- _secure_doc_text: drop the keyword blocklist that replaced phrases like
  "act as"/"disregard" with [REDACTED]. Those occur in legitimate titles and
  prose, so redaction corrupted document content. Keep the <user_document>
  framing + _SYSTEM_HARDENING system instruction as the injection defense.
- _validate_chunk_physical_indices: tolerate non-list input (extract_json
  returns {} on parse failure and may return a JSON object) instead of
  crashing while iterating a dict.
- Remove _validate_physical_indices / _parse_physical_index: range validation
  is already done by validate_and_truncate_physical_indices in meta_processor
  and marker->int by convert_physical_index_to_int; the helpers duplicated both.

Tests updated to assert the skip-not-raise behavior and lock in no-redaction
and non-list tolerance. 314 passed, 2 skipped.
2026-07-17 18:45:13 +08:00
..
backend fix: enforce collection membership on cloud query doc_ids 2026-07-16 14:40:19 +08:00
index fix: align merged hardening with dev's robustness and content fidelity 2026-07-17 18:45:13 +08:00
parser fix: empty-list scope, get_tree bool casing, md fence tracking; dedupe base URL 2026-07-10 11:17:20 +08:00
storage fix: resolve concurrency and DoS pitfalls from PR #272 review 2026-07-10 14:49:55 +08:00
__init__.py fix: address xhigh review findings for PR #272 2026-07-16 01:31:57 +08:00
agent.py fix: enforce collection membership on cloud query doc_ids 2026-07-16 14:40:19 +08:00
client.py fix: default SDK retrieve_model to gpt-5.4 instead of following model 2026-07-16 16:09:07 +08:00
cloud_api.py fix: address xhigh review findings for PR #272 2026-07-16 01:31:57 +08:00
collection.py fix: enforce collection membership on cloud doc-scoped operations 2026-07-16 06:20:24 +08:00
config.py fix: default SDK retrieve_model to gpt-5.4 instead of following model 2026-07-16 16:09:07 +08:00
config.yaml fix: default SDK retrieve_model to gpt-5.4 instead of following model 2026-07-16 16:09:07 +08:00
errors.py fix: address max-effort review findings 2026-07-13 18:49:09 +08:00
events.py fix: enforce collection membership on cloud query doc_ids 2026-07-16 14:40:19 +08:00
page_index.py Merge commit from fork 2026-07-17 13:57:21 +08:00
page_index_md.py fix(markdown): skip empty bold headings 2026-07-16 19:36:52 +08:00
retrieve.py fix: CMYK image drop, empty-doc crash, page_index shadowing, sqlite hardening, flaky tests 2026-07-09 11:58:59 +08:00
tokens.py refactor(sdk): typed returns, protocol contract, parser layering 2026-07-07 12:15:34 +08:00
types.py fix: CMYK image drop, empty-doc crash, page_index shadowing, sqlite hardening, flaky tests 2026-07-09 11:58:59 +08:00
utils.py fix: address xhigh review findings for PR #272 2026-07-16 01:31:57 +08:00