Name: M1 Wave 1: 3 security HIGH gap closure (trace ir.rule + nl_query sanitize + confirmation nonce)

State: Killed

PR State: merged

PR Author: David Tran

PR Author Email:

PR: #34

Committer: David Tran

Committer Email: davidtran.hp@gmail.com

Commit: 54e8767f483b989f0aab7e3fd891ce90231f274a

Description:

                                            [FIX] viin_ai_*: root-cause boil-the-lake of /code-review findings — preflight self-hosted + SSOT + dedupe + aggregation fixture + nonce burn (M1 W6)

Root-cause fix all 5 findings from /code-review of PR #34. Per boil-the-lake,
no shortcuts.

1. preflight-pgvector.yml: switch runs-on from ubuntu-22.04 to
   [self-hosted, "Viindoo Runbot"]. Root cause of "preflight dead" was
   org-Free-tier GH Actions quota exhaustion, not workflow code (proven by
   run 26076812824 which succeeded in 38s before quota hit). Self-hosted
   Runbot has identical pgvector/pgvector:0.8.2-pg14 service container
   confirmed via brain-tours.yml.

2. viin_ai_search/controllers/search_controller.py: error message now uses
   MAX_NL_QUERY_CHARS constant via %d interpolation (SSOT — CLAUDE.md Rule 10).

3. viin_ai_base/tests/test_trace_acl.py: remove duplicate .browse().read()
   call in test_user_cannot_read_other_users_trace — the first call's
   result was discarded, dead code.

4. viin_ai_search/tests/test_search_controller.py: replace TODO stub with
   full integration test for the aggregation path — seeds topic+template+
   provider, mocks call_completion, asserts <untrusted_context> wrap in
   the captured user message of the aggregation LLM call.

5. viin_ai_chat/controllers/chat_controller.py: nonce now single-use —
   _clear_pending_tool called on NONCE_MISMATCH to burn pending state.
   Adds AC10 test. Updates security.md §3.1 to document single-use
   semantics.

Part of Wave 1 — PR #34.
                                            

Branch: 17.0

Instance ID: 0

Age: Not started

Up-time: Not finished