Skip to content

Commit 0fbc55a

Browse files
author
Foundups Agent
committed
fix(holoindex): redact timeout diagnostics
1 parent 91beb0e commit 0fbc55a

7 files changed

Lines changed: 62 additions & 22 deletions

File tree

ModLog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
closed before Holo-dependent worker execution.
1818
- Corrected incremental, malformed-registry, scoped/capped source, linked
1919
worktree, direct-adapter, and downstream freshness truth boundaries.
20+
- Replaced caller-controlled HoloIndex timeout/exception log text with stable
21+
redacted codes after the PR CodeQL gate identified two high-severity flows.
2022
- Added the WSP_97 high-risk assumption audit, WSP_15 P0 record, module
2123
ROADMAP/TestModLogs, operator runbook, and machine contract.
2224

@@ -31,8 +33,8 @@ build/repair recursion, not a claim of unrestricted production autonomy.
3133
**WSP Compliance**: Work was isolated from concurrent lanes in a dedicated Git
3234
worktree and focused branch; no framework WSP or knowledge mirror changed.
3335
MODULE_CONCATENATION_GATE.md remains correctly unmirrored because it is a
34-
non-protocol quick reference. The final HoloIndex matrix passed 345 tests, the
35-
final non-overlapping focused matrices passed 744 tests, the independent
36+
non-protocol quick reference. The final HoloIndex matrix passed 346 tests, the
37+
final non-overlapping focused matrices passed 745 tests, the independent
3638
boundary/security review passed 289 tests, all 81 changed or added Python files
3739
compiled, WSP_00 remained green, and the WSP_97 structural receipt validated.
3840
PR evidence and clean-main post-merge activation remain pending.

docs/audits/infrastructure/HOLOINDEX_REDDOG_WSP97_EXECUTION_RECEIPT_PHASE1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"holo_index/tests/test_holoindex_embedding_space.py"
2828
],
2929
"macro_pass": [
30-
"Final no-overlap focused validation: 744 passed across HoloIndex, infrastructure owner, RedDog query/downstream, and idle-maintenance matrices.",
31-
"Final HoloIndex validation: 345 passed across storage/source/CLI/embedding, freshness/maintenance, incremental/work-ledger, and machine-contract matrices.",
30+
"Final no-overlap focused validation: 745 passed across HoloIndex, infrastructure owner, RedDog query/downstream, and idle-maintenance matrices.",
31+
"Final HoloIndex validation: 346 passed across storage/source/CLI/embedding, freshness/maintenance, incremental/work-ledger, and machine-contract matrices.",
3232
"Independent owner/client/maintenance/security validation: 289 passed.",
3333
"All 81 changed or added Python files compiled without writing bytecode."
3434
],

holo_index/ModLog.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## [2026-07-18] HOLOINDEX_REDDOG_OPERATIONAL_TRUTH_BOUNDARY_POC_PHASE1
44

55
**WSP Protocol**: WSP 00, 05, 06, 15, 22, 34, 50, 62, 64, 84, 87, 96, 97
6-
**Phase**: POC implementation; focused validation/PR evidence pending
6+
**Phase**: POC implementation complete; focused validation green; PR checks pending
77
**Agent**: 0102 architect for 012 with delegated audit/test workers
88

99
**Changes**:
@@ -28,6 +28,9 @@
2828
- FIX offline Hugging Face snapshot discovery (models--.../snapshots/<rev>)
2929
with refs/main selection and complete-artifact checks. Model/import timeout
3030
helpers now return promptly instead of waiting during executor shutdown.
31+
- REDACT timeout/dependency/failure diagnostics to stable codes and exception
32+
class names; caller-controlled query, path, hint, and exception text is never
33+
written to the timeout-wrapper log.
3134
- HARDEN the resident RedDog owner by forcing fp32 routing, disabling the
3235
generation-unbound SearchCache, comparing all seven live/reported
3336
collection_embedding_space_map values, and poisoning a backend that sees a
@@ -53,10 +56,10 @@ direct-store consumers remain outside that claim. Malformed, narrowed, capped,
5356
lexical, dirty, raced, and snapshot-only paths cannot claim operational
5457
freshness through the migrated boundary.
5558

56-
**WSP Compliance**: Newly extracted helpers are kept focused where verified;
57-
focused WSP_62 results and any architect exemptions will be recorded after the
58-
gate runs. Historical monolith debt is recorded rather than hidden. The WSP_97
59-
assumption audit and WSP_15 P0 score are in the cross-module audit.
59+
**WSP Compliance**: New helpers meet focused WSP_62 thresholds; exact temporary
60+
exemptions and ROADMAP remediation cover inherited monolith debt. The final
61+
HoloIndex matrix passed 346 tests, changed Python compiled, and the WSP_97
62+
assumption audit and WSP_15 P0 score are recorded in the cross-module audit.
6063

6164
## [2026-07-16] HOLOINDEX_MEMEX_PER_TARGET_RETRIEVAL_VERDICT_PHASE1
6265

holo_index/core/holo_index.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ def _run_with_timeout(func, timeout_sec: float, default=None, error_msg: str = "
106106
Execute a function with a hard timeout using ThreadPoolExecutor.
107107
Returns default value on timeout or exception instead of hanging.
108108
109-
Distinguishes between:
110-
- Actual timeout (FuturesTimeoutError): Log as timeout with remediation hints
111-
- Missing dependency (ImportError/ModuleNotFoundError): Log with install hint
112-
- Other exceptions: Log with original error message
109+
Distinguishes timeouts, missing dependencies, and other exceptions while
110+
emitting stable diagnostics only. error_msg and missing_dep_hint remain
111+
for call compatibility but are never logged because callers may derive
112+
them from repository content, queries, paths, or secrets.
113113
114114
WSP 97: Prevents indefinite hangs in HoloIndex operations.
115115
"""
@@ -122,17 +122,20 @@ def _run_with_timeout(func, timeout_sec: float, default=None, error_msg: str = "
122122
return future.result(timeout=timeout_sec)
123123
except FuturesTimeoutError:
124124
logger.warning(
125-
f"{error_msg} (>{timeout_sec}s). "
126-
f"Semantic search will be unavailable. "
127-
f"Raise HOLO_MODEL_IMPORT_TIMEOUT/HOLO_MODEL_LOAD_TIMEOUT or rerun after model warmup."
125+
"HOLOINDEX_OPERATION_TIMEOUT (>%.3fs); semantic search unavailable. "
126+
"Raise the bounded model timeout or rerun after model warmup.",
127+
timeout_sec,
128128
)
129129
return default
130130
except (ImportError, ModuleNotFoundError) as e:
131-
hint = missing_dep_hint or "pip install -r holo_index/requirements.txt"
132-
logger.warning(f"Missing dependency: {e}. Fix: {hint}")
131+
logger.warning(
132+
"HOLOINDEX_DEPENDENCY_UNAVAILABLE (%s); install the declared "
133+
"HoloIndex requirements or use explicit lexical diagnostics.",
134+
type(e).__name__,
135+
)
133136
return default
134137
except Exception as e:
135-
logger.warning(f"{error_msg}: {e}")
138+
logger.warning("HOLOINDEX_OPERATION_FAILED (%s)", type(e).__name__)
136139
return default
137140
finally:
138141
# A context manager waits for a running worker during __exit__, which

holo_index/core/search_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def _search_collection(
869869
lambda: model.encode(query, show_progress_bar=False).tolist(),
870870
timeout_sec=HOLO_ENCODE_TIMEOUT,
871871
default=None,
872-
error_msg=f"model.encode() timed out for query '{query[:50]}'",
872+
error_msg="model.encode() timed out",
873873
)
874874
if embedding is None:
875875
if _strict_semantic_owner(holo):

holo_index/tests/TESTModLog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
runtime map mismatch, cache-disable, and resident generation-pin regressions.
2626
- Added strict-owner collection-count and blocking-encode regressions proving
2727
swallowed errors or lexical fallback cannot produce CURRENT.
28-
- Final HoloIndex evidence: storage/source/CLI/embedding/backend 87 passed;
28+
- Added a CodeQL regression proving caller-controlled diagnostic and exception
29+
text cannot leak through timeout-wrapper logs.
30+
- Final HoloIndex evidence: storage/source/CLI/embedding/backend 88 passed;
2931
freshness/maintenance 143 passed; incremental/work-ledger 109 passed; and
30-
machine-contract validation 6 passed (345 total, no failures or skips).
32+
machine-contract validation 6 passed (346 total, no failures or skips).
3133
- Independent owner/client/maintenance/security evidence: 289 passed. These are
3234
scoped matrices, not a whole-repository claim.
3335

holo_index/tests/test_holoindex_embedding_space.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@ def test_timeout_returns_without_waiting_for_running_worker() -> None:
114114
assert elapsed < 0.15
115115

116116

117+
def test_timeout_wrapper_never_logs_caller_or_exception_text(caplog) -> None:
118+
secret = "sentinel-secret-query-material"
119+
120+
def fail_with_secret() -> None:
121+
raise RuntimeError(secret)
122+
123+
caplog.set_level("WARNING")
124+
result = _run_with_timeout(
125+
fail_with_secret,
126+
timeout_sec=0.1,
127+
default="failed",
128+
error_msg=secret,
129+
missing_dep_hint=secret,
130+
)
131+
assert result == "failed"
132+
assert secret not in caplog.text
133+
assert "HOLOINDEX_OPERATION_FAILED (RuntimeError)" in caplog.text
134+
135+
caplog.clear()
136+
result = _run_with_timeout(
137+
lambda: time.sleep(0.1),
138+
timeout_sec=0.01,
139+
default="timed-out",
140+
error_msg=secret,
141+
)
142+
assert result == "timed-out"
143+
assert secret not in caplog.text
144+
assert "HOLOINDEX_OPERATION_TIMEOUT" in caplog.text
145+
146+
117147
class _Collection:
118148
name = "navigation_code"
119149

0 commit comments

Comments
 (0)