[FIX] viin_ai cluster: Cognitive Wave-1 review remediation (10 HIGH + MED)
End-of-wave code review (6 modules) found 0 CRITICAL, 10 HIGH, 14 MED.
This pass fixes all 10 HIGH plus the cheap in-file MED, verified by a real
Odoo native test run (all fix-target tests RED-before-green, now GREEN).
Runtime / security HIGH:
- viin_ai_memory: _bump_reference iterated to fix "Expected singleton" crash
on a multi-record (L0|L1) recall set.
- viin_ai_memory: L0 identity text now wrapped via wrap_untrusted_context()
before system-prompt injection (prompt-injection surface, AGENTS.md #10).
- viin_ai_base: google_native response normalizer now extracts functionCall
parts (Gemini tool calls were silently dropped despite WI-H sending tools).
Test-integrity HIGH (fixed in-scope, not deferred):
- viin_ai_base: replaced tautological constraint-embed assertion with a real
'[constraints:' check; removed a vendor-free test that never called
production code and relocated it to viin_ai_agent calling the real
_tool_schema(); restored the real copy-before-normalize mutate-guard
(3 protocols, self-contained).
- viin_ai_skill: removed TestCoworkBundleWebQueryToolExists (always-FAIL CI
gate not controlled by the module under test).
- viin_brain: added TestBrainLinkTemporalSupersession covering create/write
auto-stamp + idempotency.
Perf / seam HIGH:
- viin_brain: batched _stamp_superseded_at (was N+1 writes).
- viin_ai_agent: _recall_memory gains trace_id param (passed at both run /
run_streaming call sites) so Memory stamps observations under the run trace
without a second agent.py touch; removed a hasattr() presence probe on a
hard-dependency method.
MED: model-ordering (_sql_constraints before fields in skill/pulse), memory
cron noupdate + child_of->in company_ids + promotion.log owner rule + decay
date pre-filter, skill group_ids now enforced in the resolver (+test),
pulse @api.depends + PASS-branch sync comment, google_native combiner
stripping, brain partial index columns (from_page_id, valid_from).
| Subbuilds | Name | State | Detail |
|---|---|---|---|
| Build 385660 | Check the quality with Pylint: from test_lint to test_pylint 14m | Failed | Log |
| Build 385661 | At install tests: from account to website_twitter 134m | Succeed | Log |
| Build 385662 | Post install tests: step install all modules 74m | Succeed | Log |
| Build 385663 | Post install tests: from account to payment_authorize 119m | Succeed | Log |
| Build 385664 | Post install tests: from payment_bidv_viin to theme_default 140m | Failed | Log |
| Build 385665 | Post install tests: from to_account_accountant to transifex 59m | Succeed | Log |
| Build 385666 | Post install tests: from uom to viin_estimate_approval 69m | Failed | Log |
| Build 385667 | Post install tests: from viin_estimate_budget to viin_project 29m | Succeed | Log |
| Build 385668 | Post install tests: from viin_project_access_timesheet to website_twitter 44m | Succeed | Log |
| Build 385669 | Test install all modules without demo data: from account to website_twitter 59m | Succeed | Log |
| Create Date | Level | Message |
|---|---|---|
| 06/15/2026 10:35:24 | INFO |
Updated repository Viindoo-odoo
|
| 06/15/2026 10:35:24 | INFO |
Updated repository Viindoo-tvtmaaddons
|
| 06/15/2026 10:35:24 | INFO |
Updated repository Viindoo-erponline-enterprise
|
| 06/15/2026 10:35:24 | INFO |
Updated repository Viindoo-branding
|
| 06/15/2026 10:35:24 | INFO |
Cloned repository Viindoo-ai
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.addons.test_lint.tests.test_manifests: FAIL: Subtest ManifestLinter.test_manifests (module='viin_ai_memory')
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/odoo/addons/test_lint/tests/test_manifests.py", line 44, in test_manifests
self._test_manifest_values(module, manifest_data)
File "/data/build/Viindoo-tvtmaaddons-17.0/to_base/__init__.py", line 362, in _test_manifest_values_plus
_test_manifest_values(self, module, manifest_data)
File "/data/build/Viindoo-odoo-17.0/odoo/addons/test_lint/tests/test_manifests.py", line 68, in _test_manifest_values
self.assertNotEqual(
AssertionError: False == False : Setting manifest key auto_install to the default manifest value for module 'viin_ai_memory'. You can remove this key from the dict to reduce noise/inconsistencies between manifests specifications and ease understanding of manifest content.
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.modules.loading: Module test_lint: 1 failures, 0 errors of 15 tests
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.addons.test_pylint.tests.test_flake8: FAIL: TestFlake8.test_flake8
Traceback (most recent call last):
File "/data/build/Viindoo-tvtmaaddons-17.0/test_pylint/tests/test_flake8.py", line 91, in test_flake8
self.fail("flake8 test failed:\n" + (b"\n" + out + b"\n" + err).decode('utf-8').strip())
AssertionError: flake8 test failed:
/data/build/rb-6a72459-222185/viin_ai_skill/tests/test_cowork_bundle.py:190:1: W391 blank line at end of file
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.modules.loading: Module test_pylint: 1 failures, 0 errors of 7 tests
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.modules.loading: At least one test failed when loading the modules.
|
| 06/15/2026 10:50:09 | ERROR |
Subbuild # 385660:
odoo.tests.result: 2 failed, 0 error(s) of 24 tests when loading database 'rb-6a72459-222185-385660'
|
| 06/15/2026 12:50:04 | WARNING |
Subbuild # 385661:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 11:50:27 | WARNING |
Subbuild # 385662:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 14:10:52 | ERROR |
Subbuild # 385664:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 14:10:52 | ERROR |
Subbuild # 385664:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (1, 1, '0.00000000', '2026-06-15 06:58:46.307350', 1, 65, 'Provider unreachable: https://api.openai.com/v1/chat/completions', 0, '2026-06-15', 56, 19, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 06:58:46.307350', 1) RETURNING "id"
DETAIL: Key (provider_id)=(19) is not present in table "viin_ai_provider".
|
| 06/15/2026 14:10:52 | WARNING |
Subbuild # 385664:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_base/models/provider.py", line 1085, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(19) is not present in table "viin_ai_provider".
|
| 06/15/2026 12:50:04 | WARNING |
Subbuild # 385665:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (viin_ai_pulse.viin_ai_work_routine_view_form): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 12:50:04 | WARNING |
Subbuild # 385665:
odoo.addons.to_base.tests.test_validate_record_rules:
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_create=False', because 'base.group_user' group has 'perm_create=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_write=False', because 'base.group_user' group has 'perm_write=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_unlink=False', because 'base.group_user' group has 'perm_unlink=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_observation_rule_owner' rule: You should set 'perm_write=False', because 'base.group_user' group has 'perm_write=False' on model 'viin.ai.memory.observation'.
'viin_ai_memory.viin_ai_memory_observation_rule_owner' rule: You should set 'perm_unlink=False', because 'base.group_user' group has 'perm_unlink=False' on model 'viin.ai.memory.observation'.
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_agent.models.agent: viin.ai.agent._execute_tool_call: tool=wi2a_sudo_tool failed: Tool wi2a_sudo_tool requests sudo execution but base.group_system is not in its allowed groups - refusing to escalate.
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_agent/models/agent.py", line 516, in _execute_tool_call
raise AccessError(_(
odoo.exceptions.AccessError: Tool wi2a_sudo_tool requests sudo execution but base.group_system is not in its allowed groups - refusing to escalate.
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_approval.models.viin_approval_request: viin_ai_approval: advisory agent 26 carries executable tools; refusing to run a read-only advisory with tools (request 3).
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_approval.models.viin_approval_request: viin_ai_approval: advisory agent Sale Approval Risk Advisor (id=5) has 1 topic(s) but topic_ids.tool_ids resolved to an empty recordset for principal uid=1 - this may indicate a missing viin.ai.tool read ACL on the cron principal; advisory will run tool-less.
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 05:24:20.857523', 1, 0, 'Provider error (401): invalid api key', 0, '2026-06-15', 88, 51, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 05:24:20.857523', 1) RETURNING "id"
DETAIL: Key (provider_id)=(51) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_base/models/provider.py", line 1085, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(51) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 05:24:20.921132', 1, 0, 'Provider unreachable: https://api.openai.com/v1/chat/completions', 0, '2026-06-15', 88, 51, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 05:24:20.921132', 1) RETURNING "id"
DETAIL: Key (provider_id)=(51) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_base/models/provider.py", line 1085, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(51) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 05:24:39.276877', 1, 40, 'Provider unreachable: https://api.openai.com/v1/embeddings', 0, '2026-06-15', 108, 86, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 05:24:39.276877', 1) RETURNING "id"
DETAIL: Key (provider_id)=(86) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | WARNING |
Subbuild # 385666:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_base/models/provider.py", line 1085, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(86) is not present in table "viin_ai_provider".
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.addons.viin_ai_chat.controllers.chat_controller: chat_message failed for agent 1
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_chat/controllers/chat_controller.py", line 70, in chat_message
result = agent.run(messages, context=context)
File "/data/build/rb-6a72459-222185/viin_ai_agent/models/agent.py", line 784, in run
system = self._assemble_system_prompt(
TypeError: TestChatController.test_context_res_model_res_id_forwarded.<locals>._capture_assemble() got an unexpected keyword argument 'applied_skills'
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.addons.viin_ai_chat.tests.test_chat_controller: ERROR: TestChatController.test_context_res_model_res_id_forwarded
Traceback (most recent call last):
File "/data/build/rb-6a72459-222185/viin_ai_chat/tests/test_chat_controller.py", line 164, in test_context_res_model_res_id_forwarded
self.assertEqual(captured_context['ctx'],
KeyError: 'ctx'
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.addons.viin_ai_chat.tests.test_chat_controller: FAIL: TestChatController.test_user_error_passed_through
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/odoo/tools/misc.py", line 825, in deco
return func(*args, **kwargs)
File "/data/build/rb-6a72459-222185/viin_ai_chat/tests/test_chat_controller.py", line 242, in test_user_error_passed_through
self.assertIn('error', payload, payload)
AssertionError: 'error' not found in {'jsonrpc': '2.0', 'id': None, 'result': {'status': 'error', 'content': 'Agent error: TestChatController.test_user_error_passed_through.<locals>._user_err() takes 1 positional argument but 2 were given', 'trace_id': None, 'iterations': 0, 'cost_usd': 0.0, 'tool_calls': 0}} : {'jsonrpc': '2.0', 'id': None, 'result': {'status': 'error', 'content': 'Agent error: TestChatController.test_user_error_passed_through.<locals>._user_err() takes 1 positional argument but 2 were given', 'trace_id': None, 'iterations': 0, 'cost_usd': 0.0, 'tool_calls': 0}}
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.addons.mail.models.mail_mail: failed sending mail (id: 352) due to You must either provide a sender address explicitly or configure using the combination of `mail.catchall.domain` and `mail.default.from` ICPs, in the server configuration file or with the --email-from startup parameter.
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/addons/mail/models/mail_mail.py", line 664, in _send
msg = SendIrMailServer.build_email(
File "/data/build/Viindoo-odoo-17.0/odoo/addons/base/models/ir_mail_server.py", line 526, in build_email
assert email_from, self.NO_FOUND_FROM
AssertionError: You must either provide a sender address explicitly or configure using the combination of `mail.catchall.domain` and `mail.default.from` ICPs, in the server configuration file or with the --email-from startup parameter.
|
| 06/15/2026 13:00:38 | ERROR |
Subbuild # 385666:
odoo.tests.result: 1 failed, 1 error(s) of 2074 tests when loading database 'rb-6a72459-222185-385666'
|