llmcpp-candidate-compilation
Table of Contents
Candidate compilation (llmcpp)
Candidate compilation checks a proposed body in its surrounding translation unit before accepting it. The tool-server fixture deliberately tries to modify a private field from outside its class:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "try_compile",
"arguments": {
"body": "account.cents = 1;"
}
}
}
In this request, the active target is the free function peek(Account& account). Account::cents is private, so compilation detects the invalid access. The agent can inspect members and use the public balance() method instead.
try_compile receives statements, not a complete function declaration. It returns diagnostics without accepting the candidate or executing it. Failed checks consume tool calls but not rejected-submission attempts. `submit` separately checks and accepts the final body.
llmcpp-candidate-compilation.md · Last modified: by 127.0.0.1
