From e8563d992cb7706546d4d7f9b8a531ee4c099e22 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 07:15:53 +0000 Subject: [PATCH] =?UTF-8?q?Lot=2047=20:=20journal=20du=20sous-agent=20ind?= =?UTF-8?q?=C3=A9pendant=20du=20poste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le briefing machine des vues des rôles nomme l'hôte et le compte : masqués dans le journal ({{HOTE}}, {{COMPTE}}), qui différait sur le poste de la CI. Il nomme aussi le système et l'architecture : journal tiré sous Linux seulement, comme les autres journaux qui dépendent du poste. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv --- internal/loki/parity_subagent_test.go | 10 ++++++++++ rust/loki-rs/tests/parity_subagent/subagent.json | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/loki/parity_subagent_test.go b/internal/loki/parity_subagent_test.go index 4d9dcf2..b3796dd 100644 --- a/internal/loki/parity_subagent_test.go +++ b/internal/loki/parity_subagent_test.go @@ -1,3 +1,5 @@ +//go:build linux + package loki import ( @@ -9,6 +11,7 @@ import ( "net/http/httptest" "net/url" "os" + "os/user" "path/filepath" "strings" "sync" @@ -195,6 +198,13 @@ func TestPariteSubagent(t *testing.T) { if h := os.Getenv("LOKI_HOME"); h != "" { got = bytes.ReplaceAll(got, []byte(h), []byte("{{HOME}}")) } + // Le briefing machine nomme l'hôte et le compte : propres au poste. + if host, _ := os.Hostname(); host != "" { + got = bytes.ReplaceAll(got, []byte("host="+host+","), []byte("host={{HOTE}},")) + } + if u, err := user.Current(); err == nil && u.Username != "" { + got = bytes.ReplaceAll(got, []byte(", user="+u.Username+","), []byte(", user={{COMPTE}},")) + } if os.Getenv("LOKI_PARITY_UPDATE") == "1" { if err := os.MkdirAll(filepath.Dir(paritySubagentFile), 0o755); err != nil { t.Fatal(err) diff --git a/rust/loki-rs/tests/parity_subagent/subagent.json b/rust/loki-rs/tests/parity_subagent/subagent.json index 3080251..c742fa1 100644 --- a/rust/loki-rs/tests/parity_subagent/subagent.json +++ b/rust/loki-rs/tests/parity_subagent/subagent.json @@ -388,7 +388,7 @@ "Role": "code-reviewer", "ComputerUse": false }, - "system": "You are the CODE REVIEW pass of code mode. Review the current changes (git_diff) for real defects.\n\nLook for, in this order: correctness bugs (wrong logic, unhandled errors, races), security issues (injection, path traversal, secrets), then significant simplifications. Ignore style and taste.\n\nFor each finding: file:line, one-line problem, one-line fix. If the diff is sound, say so in one sentence. Do not modify anything.\n\nMachine: host=vm, linux/amd64, user=root, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", + "system": "You are the CODE REVIEW pass of code mode. Review the current changes (git_diff) for real defects.\n\nLook for, in this order: correctness bugs (wrong logic, unhandled errors, races), security issues (injection, path traversal, secrets), then significant simplifications. Ignore style and taste.\n\nFor each finding: file:line, one-line problem, one-line fix. If the diff is sound, say so in one sentence. Do not modify anything.\n\nMachine: host={{HOTE}}, linux/amd64, user={{COMPTE}}, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", "tools": [ { "type": "function", @@ -533,7 +533,7 @@ "Role": "explorer", "ComputerUse": false }, - "system": "You are the EXPLORATION pass of code mode. Answer questions about the codebase without modifying anything.\n\nUse read, grep, glob and git tools to locate and understand code. Cite files as path:line. Be concise: report what you found and where, not everything you read. If the answer spans several places, list them with one line each.\n\nMachine: host=vm, linux/amd64, user=root, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", + "system": "You are the EXPLORATION pass of code mode. Answer questions about the codebase without modifying anything.\n\nUse read, grep, glob and git tools to locate and understand code. Cite files as path:line. Be concise: report what you found and where, not everything you read. If the answer spans several places, list them with one line each.\n\nMachine: host={{HOTE}}, linux/amd64, user={{COMPTE}}, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", "tools": [ { "type": "function", @@ -678,7 +678,7 @@ "Role": "planner", "ComputerUse": false }, - "system": "You are the PLANNING pass of code mode. Break the user's task down BEFORE any code is written.\n\nProduce:\n1. A short restatement of the goal (one sentence).\n2. Acceptance criteria via the criteria tool (action=add): 2-6 short, testable statements of what DONE means.\n3. The implementation steps, ordered, with the files each step touches.\n\nExplore the code (read, grep, glob, git_status) as needed to make the plan concrete — real file paths, real function names. Do not modify anything. End by asking the user to confirm the plan or amend it.\n\nMachine: host=vm, linux/amd64, user=root, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", + "system": "You are the PLANNING pass of code mode. Break the user's task down BEFORE any code is written.\n\nProduce:\n1. A short restatement of the goal (one sentence).\n2. Acceptance criteria via the criteria tool (action=add): 2-6 short, testable statements of what DONE means.\n3. The implementation steps, ordered, with the files each step touches.\n\nExplore the code (read, grep, glob, git_status) as needed to make the plan concrete — real file paths, real function names. Do not modify anything. End by asking the user to confirm the plan or amend it.\n\nMachine: host={{HOTE}}, linux/amd64, user={{COMPTE}}, cwd={{WS}}. This is your working folder: relative paths in write/edit/bash resolve here, and it is the DEFAULT place for scratch work — notes, outputs, a clone, a test. But it is DISPOSABLE: deleting the discussion wipes it. Any script you want to KEEP (or schedule), write it into your scripts folder {{HOME}}/scripts instead — a separate folder a workspace wipe won't touch; you write and run scripts there normally. Do NOT install or write files into system directories such as /usr/local/bin, /usr, /bin or /etc: those need root and are not yours. Only use an absolute path outside this folder (except your scripts folder) when the user explicitly named that location.", "tools": [ { "type": "function",