feat(opencode): the OpenCode harness, checked against its goldens

The tool source generated from the schema, the home with its view, the
shared and per-process environments, the permission rules, the commands,
the warm-up under the supervisor, the event stream and the
classification, its patterns as hand-written scanners. The goldens record
the answer for each, a warm-up against a fake opencode included.

A timed-out supervised command now gets SIGTERM, so the supervisor takes
its tree down (SIGKILL 10 s later); any other child gets SIGKILL. :Json
gains DumpCompact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-10-31 08:32:51 +01:00
commit 5253fe3aff
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
10 changed files with 1946 additions and 7 deletions

View file

@ -26,6 +26,12 @@ export namespace Crafter::Review {
return value.dump(1, ' ', true, Json::error_handler_t::replace);
}
// No whitespace, ASCII only, the keys in their order. What the MCP config
// and OpenCode's inline agent config go to their programs as.
inline std::string DumpCompact(const Json& value) {
return value.dump(-1, ' ', true, Json::error_handler_t::replace);
}
// Keys in code-point order, no whitespace, ASCII only. The
// structured-output schema goes to claude in this form and its bytes are
// part of the prompt cache, so they must not move by a byte (the goldens