refactor(prompts): the last three instructions written in Go are files (#2051)

AGENTS.md sends every instruction to a file in internal/prompts, and the
workspace scoping rule, the PR-review adversary mission and the model probe
were the three that still read as Go string literals. The text is unchanged:
the templates render the same bytes the concatenations built.
This commit is contained in:
sam committed 2026-11-21 03:48:42 +11:00
1 parent e70c27faf9
commit ee66e4f0f3
9 files changed
+37 -19

No files matched your search

-8
View File
@@ -30,14 +30,6 @@ func ClipToolCallDetail(s string) string {
return s[:cut] + "…"
}
func ProjectScopedRules(workspace, extra string) string {
rule := "Confine discovery to " + workspace + ". Do not inspect home directories, dependency/module caches, or unrelated projects unless the mission explicitly requests that external path."
if strings.TrimSpace(extra) == "" {
return rule
}
return rule + "\n" + extra
}
func ProtectionMatcher(p agentrun.Protection, readOnly bool) func(string) bool {
if readOnly || len(p.Suffixes)+len(p.Globs) == 0 {
return nil
+2 -1
View File
@@ -17,6 +17,7 @@ import (
"github.com/samcharles93/archie-core/internal/agentexec"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
"github.com/samcharles93/archie-core/internal/prompts"
"github.com/samcharles93/archie-core/internal/taskstate"
"github.com/samcharles93/archie-core/internal/tools"
)
@@ -91,7 +92,7 @@ func (r *LoopRunner) Run(ctx context.Context, workspace string, req agentrun.Req
MaxParallelToolCalls: MaxParallelToolCalls,
Mission: missionWithHistory(req),
ExtraRules: agentexec.ProjectScopedRules(workspace, req.ExtraRules),
ExtraRules: prompts.ProjectScopedRules(workspace, req.ExtraRules),
Notes: notes,
Gate: toAgentGate(req.Gate),
Preflight: toAgentCommands(req.Preflight),