Watch rules on coding sessions
Watch rules use watch-rule/v1, the format the PromptReports family uses to watch work. With REPOOPS_WATCH_RULES=1, session_signals answers two kinds of hit: the built-in Session Signals, each named for its built-in rule, and the hits of your own rules, run over the sessions this machine captured. Off, session_signals answers as before and reads no rule file.
How to
The RepoOps desktop app, capturing your coding sessions.
REPOOPS_WATCH_RULES=1 where the desktop runs.
- Write a rule file.
Put a JSON file in the
watch-rulesfolder of the desktop's data folder, holding onewatch-rule/v1rule or an array of them. Each is checked against the schema, and a refused rule never runs. - Use a kind the desktop runs.
On a session the desktop runs three kinds:
ordered_pair(a tool call with no earlier call of the tool it needs first),forbidden_value(a value in the output or a tool's arguments) andtool_loop(the same tool with the same arguments more thanmax_callstimes, 5 when absent). - Ask for the hits.
Call
session_signalsthrough the MCP or the telemetry chat. Each row says whether it is built-in or custom, and the answer lists the custom rules that ran, the ones skipped with the reason and the ones the schema refused.
Use cases
No deploy before the tests
- Situation
- An engineering manager wants to know when an agent deployed without running the tests first.
- You do
- Write an ordered_pair rule that the deploy tool needs the test tool first.
- You see
- Each session where the deploy came first shows as a custom hit beside the security signals.
An agent stuck in a loop
- Situation
- An agent calls the same tool with the same arguments over and over.
- You do
- Write a tool_loop rule.
- You see
- A session past the limit shows as a custom hit.
Expected outcome
Next step: It uses a model, runs only on steps, runs or schedules, names an action type or an event, is turned off, or is a built-in setting. The reason is beside it.
Next step: It did not pass the schema, its file is over 256 KB, or more than 500 rules were read.
Next step: Custom rules see a session's tool calls only when deep capture is on.
What else to consider
Built-in rules stay as they are
A file rule with builtin set to true is skipped: a team rule cannot change a built-in on the desktop. The built-in Session Signals scan is unchanged.
Not read from the hub yet
The desktop reads rules only from its own data folder. Reading an org's rules from promptcompute.ai is not built (LDG-3018).