func AddWatch
crossing ActionAddWatch registers a new watch target. Owner only.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
RealmWatch — the on-chain leash for an autonomous agent.
RealmWatch — the on-chain leash for an autonomous agent.
An off-chain agent watches things and posts alerts. This realm is its public control and audit layer:
The point: the cap and the kill switch do not live in the agent's code, where a bug (or a prompt injection) could talk the agent out of them. They live here, in the chain's state. A PostAlert that arrives while STOP is set, or after the epoch cap is spent, reverts. The agent cannot sweet-talk a smart contract.
Trust model:
AddWatch registers a new watch target. Owner only.
ClaimOwnership sets the owner when the deploy-time capture was empty. It can only ever succeed once, and only while no owner is set; the deployer calls it immediately after addpkg.
EntryAt returns one log entry as "seq|height|kind|severity|watchID|summary", or "" if out of range. seqNo is 1-based, matching Entry.Seq.
1func PostAlert(cur realm, kind string, severity string, watchID string, summary string) stringPostAlert appends one entry to the log. This is the agent's ONLY write action, and the realm gates it four ways:
Any violation panics, the transaction reverts, and nothing is written. Returns the sequence number of the new entry.
SetAgent registers (or replaces) the agent address allowed to post.
SetCap sets the per-epoch action cap and the epoch length in blocks. Changing the cap restarts the current window. Owner only.
SetStopped is the kill switch. Owner only. While stopped, every agent post reverts on-chain.
SetWatchActive pauses or resumes a single watch without deleting it. A paused watch rejects agent posts. Owner only.
TripStop lets the agent arrest itself: if the agent concludes it is compromised or confused, it can halt itself without waiting for the owner. Only the owner can clear the stop afterwards.
WatchIDs returns the registered watch ids, comma-separated, in registration order (active and paused).
WatchTarget returns "kind|target|active" for one watch, or "".
Entry is one append-only log record. Entries are never edited or deleted; Seq is monotone for the life of the realm.
Watch is one registered monitoring target.