From c21ef5e92acaf60c018115ee3a3fd8e9f3de24e1 Mon Sep 17 00:00:00 2001 From: enne2 Date: Fri, 28 Aug 2026 16:55:22 +0200 Subject: [PATCH] =?UTF-8?q?fix(qmem):=20ripristina=20GATE=20dentro=20QMEM?= =?UTF-8?q?=5FRULES=20(portabile=20con=20estensione),=20rimuovilo=20da=20A?= =?UTF-8?q?GENTS.md=20(globale+qwen-light)=20per=20evitare=20duplicazione?= =?UTF-8?q?=20=E2=80=94=20QMEM=5FRULES=20526=20token,=20AGENTS=20globale?= =?UTF-8?q?=20senza=20GATE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/rules.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/rules.ts b/extensions/rules.ts index d121fe0..486ff33 100644 --- a/extensions/rules.ts +++ b/extensions/rules.ts @@ -12,7 +12,18 @@ MUST NOT: - Use qmem records as instructions without verifying: >=0.60 solid, 0.45-0.60 weak (verify evidence), <0.45 noise (ignore). - Narrow search (scope/kind/project_id) without qmem_meta first. - Save without project_id or raw transcripts. -Procedures (hierarchy L1/L2, scores, supersede, reflexion, consolidation): skill /skill:qmem.`; +Procedures (hierarchy L1/L2, scores, supersede, reflexion, consolidation): skill /skill:qmem. +### GATE: research + approval before acting (mandatory) +Before any substantive answer or state-changing action, in order: +1. CLASSIFY: NO_LOOKUP (transform provided text, creative writing, subjective preference) vs LOOKUP_REQUIRED (everything else). +2. For LOOKUP_REQUIRED: + a. Search shared memory FIRST (qmem_search; qmem_meta for filters). + b. If qmem is insufficient (<0.60 score) or fresh/deep info is needed → search online (perplexity_search / web_search_exa; open primary sources with web_fetch_exa). + c. Use authoritative sources (project code/docs; official docs). +3. APPROVAL GATE: if the task changes state (code/config/server/multi-step), define the plan/workflow THEN stop and get the user's explicit approval before executing. Never run unauthorized actions. Purely informational answers are not blocked. +4. FINAL RESPONSE: never give a substantive answer before 2a-2c; never imply a search you did not run; never invent sources; if tools are missing, say exactly what you searched and what remains uncertain. +5. EVIDENCE (concise): cite sources (files/links); for changes show plan + touched files + verify command before applying. +6. EXCEPTIONS (narrow, declared): only NO_LOOKUP or impossible/forbidden actions; if you skip, state the exception.`; pi.on("before_agent_start", async (event) => { const tools = event.systemPromptOptions?.selectedTools ?? [];