feat(builder): bounded model requests, a safety check, and a clearer PR summary
- The drafter no longer grows one conversation. Each request is the rules and facts, the model's latest template, what is wrong now and one line per earlier round, so long builds can't push the facts out of the model's 32K context (Ollama drops the oldest part silently). The image's scripts in the facts are capped at 24000 characters in all, and diagnosis check results at 16000. - Every model call logs its prompt and answer tokens, with a warning near the context limit. - unsafeCommands: a draft whose startup command or installConfig pipes a download into a shell, decodes base64, uses eval, raw network tools or /dev/tcp, sudo/su, setuid bits, writes /etc, touches cron/systemd/firewall, or looks like a miner goes back to the model. AUTHORING.md has the rule. - The PR summary lists every address nodes would download from under "Review carefully", marks the measured checks as measured, and labels the research notes as the model's reading, not checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a80a6ebc5
commit
00cc61aba2
7 files changed
+249
-24
No files matched your search
@@ -188,6 +188,10 @@ func (iv *investigator) runChecks(checks []checkRequest) string {
|
||||
}
|
||||
b.WriteString("\n")
|
||||
}
|
||||
// Bounded, like every request: pages can be long, and the model's context is not
|
||||
if s := b.String(); len(s) > 16000 {
|
||||
return s[:16000] + "\n...(cut: check results too long)\n"
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user