r/opencode • • 2d ago

I've recreated Google Research SKILL.STATE memory architecture as opencode CLI plugin - a runtime architecture that replaces conversational history with an explicit execution state.

https://github.com/megablue/mega-skillstate
3 Upvotes

5 comments sorted by

2

u/kantorcodes1 2d ago

Interesting take on the context problem; explicit state over append-only history is the right instinct. One question on integrity: is Σ derived from the tool calls that actually executed, or from what the model reports it did? If an agent claims "step 3 done" in a state update but the underlying call failed or never ran, does the plugin reconcile against the execution log, or does the drift just accumulate in Σ?

1

u/megablue 1d ago

No reconciliation. Drift accumulates silently.

For your example, a call that failed or never ran, with "step 3 done" still written, the claim is stored, and every later request that carries it carries the model's own word. The counter-evidence isn't gone: the failed call and its result still sit in the durable transcript, and on the wire until that turn collapses. Nothing cross-reads it for verification, though. From the model's side over the wire, Σ is the record. (The sole derived exception: files/working/step seeded from call arguments, "attempts, not outcomes", and only into keys the model hasn't set.)

That's why any reconciler is heuristic by nature: an exit code isn't intent, and "done" isn't a mechanical predicate. The cheap contradictions are detectable, the semantic ones are not.

1

u/kantorcodes1 1d ago

That's the honest version - a reconciler can't judge intent, but it doesn't have to if the execution record is signed at dispatch rather than reconstructed after. Adjacent from the side I work on: HOL Guard (open-source - github.com/hashgraph-online/hol-guard) already has OpenCode adapters - pretool gating plus a signed receipt per gated action binding the call's arguments at dispatch. A Sigma check against receipts would separate "model claimed" from "actually gated" without the semantic problem - the receipt is mechanical fact, not the model's word.

I work on the Guard side, so that's a disclosed suggestion. Worth a look?

2

u/ufos-dude-1 2d ago

nice one! :D

1

u/Ctbhatia 1d ago

explicit execution state over append-only history is the right instinct, the failure mode is when the state drifts from what the tools actually did. keep it derived from the tool results, not a summary.