@intutic/sync-daemon 2.9.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/disconnect/harnesses.d.ts.map +1 -1
  2. package/dist/disconnect/harnesses.js +4 -3
  3. package/dist/disconnect/harnesses.js.map +1 -1
  4. package/dist/disconnect/plan.d.ts +6 -1
  5. package/dist/disconnect/plan.d.ts.map +1 -1
  6. package/dist/disconnect/plan.js +4 -2
  7. package/dist/disconnect/plan.js.map +1 -1
  8. package/dist/harness/antigravityCliHooks.js +3 -3
  9. package/dist/harness/antigravityCliHooks.js.map +1 -1
  10. package/dist/harness/antigravityHooks.d.ts +8 -0
  11. package/dist/harness/antigravityHooks.d.ts.map +1 -1
  12. package/dist/harness/antigravityHooks.js +27 -5
  13. package/dist/harness/antigravityHooks.js.map +1 -1
  14. package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
  15. package/dist/harness/claudeCodeHooks.js +58 -16
  16. package/dist/harness/claudeCodeHooks.js.map +1 -1
  17. package/dist/harness/clineHooks.d.ts.map +1 -1
  18. package/dist/harness/clineHooks.js +4 -2
  19. package/dist/harness/clineHooks.js.map +1 -1
  20. package/dist/harness/codexHooks.d.ts.map +1 -1
  21. package/dist/harness/codexHooks.js +4 -2
  22. package/dist/harness/codexHooks.js.map +1 -1
  23. package/dist/harness/cursorHooks.d.ts.map +1 -1
  24. package/dist/harness/cursorHooks.js +8 -3
  25. package/dist/harness/cursorHooks.js.map +1 -1
  26. package/dist/harness/gateBody.d.ts +177 -4
  27. package/dist/harness/gateBody.d.ts.map +1 -1
  28. package/dist/harness/gateBody.js +1658 -26
  29. package/dist/harness/gateBody.js.map +1 -1
  30. package/dist/harness/githubCopilotHooks.js +3 -3
  31. package/dist/harness/githubCopilotHooks.js.map +1 -1
  32. package/dist/harness/gooseHooks.d.ts.map +1 -1
  33. package/dist/harness/gooseHooks.js +8 -1
  34. package/dist/harness/gooseHooks.js.map +1 -1
  35. package/dist/harness/grokHooks.js +2 -2
  36. package/dist/harness/hermesHooks.js +1 -1
  37. package/dist/harness/hermesHooks.js.map +1 -1
  38. package/dist/harness/museHooks.d.ts.map +1 -1
  39. package/dist/harness/museHooks.js +4 -2
  40. package/dist/harness/museHooks.js.map +1 -1
  41. package/dist/harness/n8nHooks.js +1 -1
  42. package/dist/harness/openCodeHooks.d.ts.map +1 -1
  43. package/dist/harness/openCodeHooks.js +32 -8
  44. package/dist/harness/openCodeHooks.js.map +1 -1
  45. package/dist/harness/openclawHooks.d.ts.map +1 -1
  46. package/dist/harness/openclawHooks.js +19 -8
  47. package/dist/harness/openclawHooks.js.map +1 -1
  48. package/dist/harness/piHooks.js +7 -7
  49. package/dist/harness/windsurfHooks.js +2 -2
  50. package/dist/index.d.ts +9 -3
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +8 -2
  53. package/dist/index.js.map +1 -1
  54. package/dist/lib/approvedBypasses.d.ts +17 -4
  55. package/dist/lib/approvedBypasses.d.ts.map +1 -1
  56. package/dist/lib/approvedBypasses.js +17 -4
  57. package/dist/lib/approvedBypasses.js.map +1 -1
  58. package/dist/lib/approvedPlans.d.ts +73 -0
  59. package/dist/lib/approvedPlans.d.ts.map +1 -0
  60. package/dist/lib/approvedPlans.js +124 -0
  61. package/dist/lib/approvedPlans.js.map +1 -0
  62. package/dist/lib/decideLogs.d.ts +46 -0
  63. package/dist/lib/decideLogs.d.ts.map +1 -0
  64. package/dist/lib/decideLogs.js +160 -0
  65. package/dist/lib/decideLogs.js.map +1 -0
  66. package/dist/lib/policySnapshot.d.ts +143 -3
  67. package/dist/lib/policySnapshot.d.ts.map +1 -1
  68. package/dist/lib/policySnapshot.js +480 -14
  69. package/dist/lib/policySnapshot.js.map +1 -1
  70. package/dist/lib/refusalDetailPy.d.ts +11 -0
  71. package/dist/lib/refusalDetailPy.d.ts.map +1 -0
  72. package/dist/lib/refusalDetailPy.js +109 -0
  73. package/dist/lib/refusalDetailPy.js.map +1 -0
  74. package/dist/lib/ruleRecordPy.d.ts +11 -0
  75. package/dist/lib/ruleRecordPy.d.ts.map +1 -0
  76. package/dist/lib/ruleRecordPy.js +277 -0
  77. package/dist/lib/ruleRecordPy.js.map +1 -0
  78. package/dist/lib/scopeMatchPy.d.ts +11 -0
  79. package/dist/lib/scopeMatchPy.d.ts.map +1 -0
  80. package/dist/lib/scopeMatchPy.js +278 -0
  81. package/dist/lib/scopeMatchPy.js.map +1 -0
  82. package/dist/lib/sopFiles.d.ts.map +1 -1
  83. package/dist/lib/sopFiles.js +5 -3
  84. package/dist/lib/sopFiles.js.map +1 -1
  85. package/dist/lib/testOutcomePy.d.ts +11 -0
  86. package/dist/lib/testOutcomePy.d.ts.map +1 -0
  87. package/dist/lib/testOutcomePy.js +371 -0
  88. package/dist/lib/testOutcomePy.js.map +1 -0
  89. package/dist/skillWriter.d.ts +1 -1
  90. package/dist/skillWriter.d.ts.map +1 -1
  91. package/dist/skillWriter.js +7 -0
  92. package/dist/skillWriter.js.map +1 -1
  93. package/dist/syncCycle.d.ts +15 -2
  94. package/dist/syncCycle.d.ts.map +1 -1
  95. package/dist/syncCycle.js +15 -3
  96. package/dist/syncCycle.js.map +1 -1
  97. package/package.json +5 -5
@@ -0,0 +1,371 @@
1
+ /**
2
+ * The test outcome decision and the per-session outcome state in Python, for the bash gates (their extractor already requires
3
+ * python3), emitted after the phrase matcher (`phrasesPy.ts`) in `GATE_PY_LIB`.
4
+ *
5
+ * Byte-identical to `packages/intutic-clawde/intutic_clawde/gate/test_outcome.py`,
6
+ * which a test compares; edit that file and copy it here. It is the
7
+ * transliteration of `@intutic/shared-types`'s testOutcome.ts, and both run the
8
+ * shared vectors. No backtick or dollar-brace, which this copy cannot hold.
9
+ */
10
+ export const TEST_OUTCOME_PY_SOURCE = String.raw `"""Did the tests pass? The deciding function behind the qualified ordering rule
11
+ requires_before: action:run_tests[ok] -> action:deploy, and the
12
+ per-session state a gate keeps of it.
13
+
14
+ A transliteration of packages/shared-types/src/testOutcome.ts; read that
15
+ module's docstring for the steps. In short, decide_test_outcome says failed
16
+ for a non-zero exit code, an error flag, a false success flag, a runner
17
+ summary with failures, or a summary saying no tests ran; ok for exit code 0,
18
+ or, with no exit code, a summary that counts a pass; and unknown otherwise,
19
+ which leaves a qualified rule unmet as a failure does.
20
+
21
+ Every port runs packages/shared-types/fixtures/test-outcome-vectors.json. The
22
+ bash hook gates emit this file verbatim, so it must stay self-contained: the
23
+ standard library only, no module state beyond the constants below, and no
24
+ backtick or dollar-brace, which a TypeScript copy cannot hold.
25
+
26
+ Inputs and states are plain dicts with the TypeScript field names
27
+ (exitCode, isError, success, output; {"v": 1, "outcomes":
28
+ {...}}), so a gate can read and write the same state file.
29
+ """
30
+
31
+ import json
32
+ import re
33
+
34
+ OUTCOME_TOKENS = ("action:run_tests",)
35
+ OUTCOME_QUALIFIERS = ("ok",)
36
+ TEST_OUTPUT_TAIL_BYTES = 65536
37
+ TEST_OUTPUT_LINE_BYTES = 1024
38
+ TEST_OUTPUT_JSON_MAX_CHARS = 1048576
39
+ OUTCOME_STATE_TTL_MS = 86400000
40
+ _MAX_SAFE_INTEGER = 9007199254740991
41
+
42
+ _ANSI = re.compile(r"\x1b\[[0-9;?]*[A-Za-z]")
43
+ _EXIT_CODE = re.compile(r"exit code:? (-?[0-9]{1,9})\Z", re.IGNORECASE | re.ASCII)
44
+ _EXIT_STATUS = re.compile(r"exit status ([0-9]{1,9})\Z")
45
+ _EXITED = re.compile(r"(?:Process|Command) exited with code (-?[0-9]{1,9})")
46
+ _COUNT = re.compile(r"([0-9]{1,9}) ([a-z]+)")
47
+ _PYTEST_NONE = re.compile(r"=+ no tests ran")
48
+ _PYTEST = re.compile(r"=+ (.+) in [0-9.]+s.* =+\Z")
49
+ _JEST = re.compile(r"Tests:[ \t]+(.+)\Z")
50
+ _VITEST = re.compile(r"[ \t]*Tests[ \t]+(.+)\Z")
51
+ _GO_OK = re.compile(r"ok[ \t]+[^ \t]+")
52
+ _GO_FAIL = re.compile(r"FAIL(?:[ \t]|\Z)")
53
+ _GO_FAIL_TEST = re.compile(r"--- FAIL:")
54
+ _CARGO = re.compile(r"test result: (ok|FAILED)\. ([0-9]{1,9}) passed; ([0-9]{1,9}) failed;")
55
+ _MOCHA_PASS = re.compile(r"[ \t]*([0-9]{1,9}) passing")
56
+ _MOCHA_FAIL = re.compile(r"[ \t]*([0-9]{1,9}) failing")
57
+ _RSPEC = re.compile(r"([0-9]{1,9}) examples?, ([0-9]{1,9}) failures?")
58
+
59
+
60
+ def _utf8_len(ch):
61
+ cp = ord(ch)
62
+ if cp < 0x80:
63
+ return 1
64
+ if cp < 0x800:
65
+ return 2
66
+ if cp < 0x10000:
67
+ return 3
68
+ return 4
69
+
70
+
71
+ def _utf8_tail(s, max_bytes):
72
+ """The last max_bytes bytes of s as UTF-8, starting on a character."""
73
+ total = 0
74
+ i = len(s)
75
+ while i > 0:
76
+ n = _utf8_len(s[i - 1])
77
+ if total + n > max_bytes:
78
+ break
79
+ total += n
80
+ i -= 1
81
+ return s[i:]
82
+
83
+
84
+ def _utf8_head(s, max_bytes):
85
+ """The first max_bytes bytes of s as UTF-8, ending on a character."""
86
+ total = 0
87
+ i = 0
88
+ while i < len(s):
89
+ n = _utf8_len(s[i])
90
+ if total + n > max_bytes:
91
+ break
92
+ total += n
93
+ i += 1
94
+ return s[:i]
95
+
96
+
97
+ def _lines(text):
98
+ """The lines of text, each cut to 1 KiB, without carriage returns or ANSI sequences."""
99
+ return [_ANSI.sub("", _utf8_head(raw, TEST_OUTPUT_LINE_BYTES).replace("\r", "")) for raw in text.split("\n")]
100
+
101
+
102
+ def _integer_or_none(v):
103
+ """A JSON integer exit code, or None."""
104
+ if isinstance(v, bool):
105
+ return None
106
+ if isinstance(v, int) and abs(v) <= _MAX_SAFE_INTEGER:
107
+ return v
108
+ if isinstance(v, float) and v.is_integer() and abs(v) <= _MAX_SAFE_INTEGER:
109
+ return int(v)
110
+ return None
111
+
112
+
113
+ def extract_exit_code(output):
114
+ """The exit code a run's text reports, or None. See testOutcome.ts extractExitCode."""
115
+ if not isinstance(output, str) or output == "":
116
+ return None
117
+ trimmed = output.strip()
118
+ if len(trimmed) <= TEST_OUTPUT_JSON_MAX_CHARS and trimmed[:1] == "{" and trimmed[-1:] == "}":
119
+ try:
120
+ parsed = json.loads(trimmed)
121
+ except ValueError:
122
+ parsed = None
123
+ if isinstance(parsed, dict):
124
+ meta = parsed.get("metadata")
125
+ if isinstance(meta, dict):
126
+ m = _integer_or_none(meta.get("exit_code"))
127
+ if m is not None:
128
+ return m
129
+ for key in ("exit_code", "exitCode"):
130
+ v = _integer_or_none(parsed.get(key))
131
+ if v is not None:
132
+ return v
133
+ head = _utf8_head(output, TEST_OUTPUT_TAIL_BYTES)
134
+ parts = [head] if len(head) == len(output) else [head, _utf8_tail(output[len(head):], TEST_OUTPUT_TAIL_BYTES)]
135
+ for part in parts:
136
+ for raw in _lines(part):
137
+ line = raw.lstrip(" \t").rstrip(" \t")
138
+ m = _EXIT_CODE.match(line) or _EXIT_STATUS.match(line) or _EXITED.match(line)
139
+ if m:
140
+ return int(m.group(1))
141
+ return None
142
+
143
+
144
+ def _counts(text):
145
+ """'N word' pieces of a summary, split on ',' and '|': the count of each word."""
146
+ counts = {}
147
+ for piece in re.split(r"[,|]", text):
148
+ m = _COUNT.match(piece.lstrip(" \t"))
149
+ if m:
150
+ counts[m.group(2)] = counts.get(m.group(2), 0) + int(m.group(1))
151
+ return counts
152
+
153
+
154
+ def parse_test_summaries(output):
155
+ """The runner summaries in the last 64 KiB of output, in order (go and mocha folded into one each)."""
156
+ if not isinstance(output, str) or output == "":
157
+ return []
158
+ out = []
159
+ go = None
160
+ mocha = None
161
+ for line in _lines(_utf8_tail(output, TEST_OUTPUT_TAIL_BYTES)):
162
+ if _PYTEST_NONE.match(line):
163
+ out.append({"runner": "pytest", "passed": 0, "failed": 0, "noTests": True})
164
+ continue
165
+ m = _PYTEST.match(line)
166
+ if m:
167
+ c = _counts(m.group(1))
168
+ if not any(k in c for k in ("passed", "failed", "error", "errors")):
169
+ continue
170
+ out.append({"runner": "pytest", "passed": c.get("passed", 0),
171
+ "failed": c.get("failed", 0) + c.get("error", 0) + c.get("errors", 0),
172
+ "noTests": c.get("passed") == 0})
173
+ continue
174
+ m = _JEST.match(line)
175
+ if m:
176
+ c = _counts(m.group(1))
177
+ out.append({"runner": "jest", "passed": c.get("passed", 0), "failed": c.get("failed", 0),
178
+ "noTests": c.get("passed") == 0 or c.get("total") == 0})
179
+ continue
180
+ m = _VITEST.match(line)
181
+ if m:
182
+ c = _counts(m.group(1))
183
+ if "passed" not in c and "failed" not in c:
184
+ continue
185
+ out.append({"runner": "vitest", "passed": c.get("passed", 0), "failed": c.get("failed", 0),
186
+ "noTests": c.get("passed") == 0})
187
+ continue
188
+ if _GO_OK.match(line):
189
+ if go is None:
190
+ go = {"runner": "go", "passed": 0, "failed": 0, "noTests": False}
191
+ out.append(go)
192
+ go["passed"] += 1
193
+ continue
194
+ if _GO_FAIL.match(line) or _GO_FAIL_TEST.match(line):
195
+ if go is None:
196
+ go = {"runner": "go", "passed": 0, "failed": 0, "noTests": False}
197
+ out.append(go)
198
+ go["failed"] += 1
199
+ continue
200
+ m = _CARGO.match(line)
201
+ if m:
202
+ passed, failed = int(m.group(2)), int(m.group(3))
203
+ out.append({"runner": "cargo", "passed": passed,
204
+ "failed": 1 if m.group(1) == "FAILED" and failed == 0 else failed,
205
+ "noTests": passed == 0})
206
+ continue
207
+ m = _MOCHA_PASS.match(line)
208
+ if m:
209
+ if mocha is None:
210
+ mocha = {"runner": "mocha", "passed": 0, "failed": 0, "noTests": False}
211
+ out.append(mocha)
212
+ mocha["passed"] += int(m.group(1))
213
+ if int(m.group(1)) == 0:
214
+ mocha["noTests"] = True
215
+ continue
216
+ m = _MOCHA_FAIL.match(line)
217
+ if m:
218
+ if mocha is None:
219
+ mocha = {"runner": "mocha", "passed": 0, "failed": 0, "noTests": False}
220
+ out.append(mocha)
221
+ mocha["failed"] += int(m.group(1))
222
+ continue
223
+ m = _RSPEC.match(line)
224
+ if m:
225
+ examples, failures = int(m.group(1)), int(m.group(2))
226
+ out.append({"runner": "rspec", "passed": max(0, examples - failures), "failed": failures,
227
+ "noTests": examples == 0})
228
+ return out
229
+
230
+
231
+ def decide_test_outcome(inp):
232
+ """The outcome of one test run, as {"outcome": ok|failed|unknown, "why": ...}.
233
+
234
+ 'inp' carries any of exitCode, isError, success and output.
235
+ """
236
+ exit_code = inp.get("exitCode")
237
+ if isinstance(exit_code, bool) or not isinstance(exit_code, (int, float)) or _integer_or_none(exit_code) is None:
238
+ exit_code = None
239
+ else:
240
+ exit_code = int(exit_code)
241
+ if exit_code is not None and exit_code != 0:
242
+ return {"outcome": "failed", "why": "exit_code"}
243
+ if inp.get("isError") is True:
244
+ return {"outcome": "failed", "why": "is_error"}
245
+ if inp.get("success") is False:
246
+ return {"outcome": "failed", "why": "success_false"}
247
+ passed = 0
248
+ no_tests = False
249
+ for s in parse_test_summaries(inp.get("output")):
250
+ if s["failed"] > 0:
251
+ return {"outcome": "failed", "why": "summary_failed"}
252
+ passed += s["passed"]
253
+ if s["noTests"]:
254
+ no_tests = True
255
+ if passed == 0 and no_tests:
256
+ return {"outcome": "failed", "why": "no_tests"}
257
+ if exit_code == 0:
258
+ return {"outcome": "ok", "why": "exit_zero"}
259
+ if passed >= 1:
260
+ return {"outcome": "ok", "why": "summary_passed"}
261
+ return {"outcome": "unknown", "why": "no_signal"}
262
+
263
+
264
+ def ordering_qualifier_error(side, left):
265
+ """Why one side of an ordering rule cannot carry its qualifier, or None."""
266
+ if "[" not in side and "]" not in side:
267
+ return None
268
+ if left and side == "action:run_tests[ok]":
269
+ return None
270
+ return json.dumps(side, ensure_ascii=False) + ": [ok] qualifies only action:run_tests, on the left of ->"
271
+
272
+
273
+ def split_qualifier(token):
274
+ """action:run_tests[ok] as ("action:run_tests", "ok"); any other token unqualified."""
275
+ return ("action:run_tests", "ok") if token == "action:run_tests[ok]" else (token, None)
276
+
277
+
278
+ def empty_outcome_state():
279
+ return {"v": 1, "outcomes": {}}
280
+
281
+
282
+ def outcome_state_file_name(harness, session_id, sha256_hex):
283
+ """The first 32 hex of sha256(harness NUL session_id), and .json."""
284
+ return sha256_hex(harness + "\0" + session_id)[:32] + ".json"
285
+
286
+
287
+ def parse_outcome_state(text):
288
+ """A state file's text as a state, or None when it is not one."""
289
+ try:
290
+ v = json.loads(text)
291
+ except ValueError:
292
+ return None
293
+ if not isinstance(v, dict) or v.get("v") != 1 or isinstance(v.get("v"), bool) or not isinstance(v.get("outcomes"), dict):
294
+ return None
295
+ outcomes = {}
296
+ for key, e in v["outcomes"].items():
297
+ if not isinstance(e, dict):
298
+ return None
299
+ at = e.get("at")
300
+ if e.get("o") not in ("ok", "failed", "unknown") or isinstance(at, bool) or not isinstance(at, (int, float)):
301
+ return None
302
+ if at != at or at in (float("inf"), float("-inf")):
303
+ return None
304
+ if "why" in e and not isinstance(e["why"], str):
305
+ return None
306
+ if "changed" in e and e["changed"] is not True:
307
+ return None
308
+ if "later" in e and e["later"] is not True:
309
+ return None
310
+ outcomes[key] = e
311
+ return {"v": 1, "outcomes": outcomes}
312
+
313
+
314
+ def record_test_outcome(state, token, decision, at_ms):
315
+ """state with token's outcome replaced by this run's."""
316
+ outcomes = dict(state["outcomes"])
317
+ outcomes[token] = {"o": decision["outcome"], "at": at_ms, "why": decision["why"]}
318
+ return {"v": 1, "outcomes": outcomes}
319
+
320
+
321
+ def note_completed_call(state, changed_files):
322
+ """state after another call completed: none adjacent any more, and stale after a file change."""
323
+ outcomes = {}
324
+ for key, e in state["outcomes"].items():
325
+ nxt = {"o": e["o"], "at": e["at"]}
326
+ if "why" in e:
327
+ nxt["why"] = e["why"]
328
+ if e.get("changed") or changed_files:
329
+ nxt["changed"] = True
330
+ nxt["later"] = True
331
+ outcomes[key] = nxt
332
+ return {"v": 1, "outcomes": outcomes}
333
+
334
+
335
+ def prerequisite_case(state, token, adjacent, now_ms):
336
+ """(case, why): met only for an ok younger than a day that no file change followed
337
+ (and, adjacent, no other call)."""
338
+ e = None if state is None else state["outcomes"].get(token)
339
+ if e is None or not (now_ms - e["at"] < OUTCOME_STATE_TTL_MS) or e["at"] > now_ms:
340
+ return ("none", None)
341
+ if e["o"] == "failed":
342
+ return ("failed", e.get("why"))
343
+ if e["o"] == "unknown":
344
+ return ("unknown", e.get("why"))
345
+ if e.get("changed"):
346
+ return ("changed", None)
347
+ if adjacent and e.get("later"):
348
+ return ("not_adjacent", None)
349
+ return ("met", None)
350
+
351
+
352
+ def prerequisite_unmet_reason(first, then, case, why, harness):
353
+ """The PREREQUISITE_UNMET reason for every case but met, byte for byte as every port words it."""
354
+ head = then + " needs a passing " + first + " first; "
355
+ if case == "none":
356
+ return head + "none ran in this session"
357
+ if case == "failed":
358
+ return head + "the last " + first + " failed (" + (why if why is not None else "failed") + ")"
359
+ if case == "unknown":
360
+ return head + "the result of the last " + first + " could not be read; rerun the tests so their summary is visible"
361
+ if case == "changed":
362
+ return head + "files changed after the last passing " + first + "; rerun the tests"
363
+ if case == "not_adjacent":
364
+ return head + then + " must come directly after it, and another call came between"
365
+ if case == "not_observable":
366
+ return head + harness + " reports no tool results Intutic can read, so a passing run cannot be observed here"
367
+ if case == "no_session":
368
+ return head + harness + " sent no session id, so test results cannot be tied to this session"
369
+ return ""
370
+ `;
371
+ //# sourceMappingURL=testOutcomePy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testOutcomePy.js","sourceRoot":"","sources":["../../src/lib/testOutcomePy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwW/C,CAAA"}
@@ -28,7 +28,7 @@ export declare const RULE_AUTHOR_SKILL = "---\nname: intutic-rule-author\ndescri
28
28
  /** Workspace-relative path the Kitkat skill is written to. */
29
29
  export declare const KITKAT_SKILL_PATH: string;
30
30
  /** Embedded copy of .agents/skills/intutic-governance-kitkat/SKILL.md (canonical). */
31
- export declare const KITKAT_SKILL = "---\nname: intutic-governance-kitkat\ndescription: Guide and execute Intutic governed developer workflows, ticket cost attributions, pre-flight token predictions, and safety policy interceptions using the Kitkat persona.\n---\n\n# \uD83D\uDC31 Kitkat \u2014 Intutic Agentic Governance Skill\n\nHello! I am **Kitkat**, your friendly agentic control plane assistant for the Intutic Governance Engine. I ensure that your AI agentic workflows are safe, structured, FinOps-optimized, and compliant with both global enterprise policies (Notion/Confluence) and local rules.\n\n---\n\n## \uD83D\uDEE0\uFE0F CLI Reference Catalog\n\nUse the `intutic` CLI commands to manage the daemon, inspect execution traces, or manage governed task loops in your workspace:\n\n### 1. Connection & Session Setup\n- **Initialize Workspace:** `intutic init` (detects the developer harnesses in the workspace, like Claude Code or Cursor, and records them in `~/.intutic/config.json`).\n- **Install Gates:** `intutic gates install [--harness <id>] [--route] [--dry-run]` (writes each recorded harness's blocking hooks, and its rules file from the local SOPs in `.intutic/sops/`, with no control plane; `--route` also points the harnesses at the local proxy, which must then be running).\n- **Start the Proxy:** `intutic start` (boots the local interceptor proxy, and refreshes installed gates at start and whenever `.intutic/sops/` changes).\n- **Stop Governing:** `intutic disconnect [--harness <id>] [--dry-run] [--keep-login]` (restores every harness config Intutic changed and removes its hooks). Run it only when the user asks; `--dry-run` shows what would change.\n\n### 2. Traces & Auditing\n- **Check Budget:** `intutic budget` (displays the local daily spend cap and today's spend; with a control plane, the workspace limits too).\n- **List Sessions:** `intutic traces list`\n- **Inspect Session Trace:** `intutic traces inspect <trace_id>`\n\n### 3. Governed Task Loops (control plane only)\n- **Start Task Loop:** `intutic loop start --name <name> [--budget <USD>] [--sops <indices_or_names>] [--auto-judge]`\n- **Execute Wrapped Agent:** `intutic loop exec --name <name> [--budget <USD>] [--sops <indices_or_names>] [--auto-judge] -- <command>`\n- **Complete/Kill Loop:** `intutic loop complete <loopRunId>` / `intutic loop kill <loopRunId>`\n- **List Active Loops:** `intutic loop list`\n\n---\n\n## \uD83D\uDD0C Interception & Command Prepends\n\nWhen interacting with LLM providers through the local proxy, prepend requests with `@intutic` (or `/intutic`) to control the active governance session:\n\n### 1. Cost & Task Attribution\n- **Initialize Picker:** `@intutic initialize`\n - *Description:* Lists the open tickets on the workspace's Jira and Linear connections, numbered, and marks the one the current git branch names as Recommended.\n- **Lock Session & Scope Rules:** `@intutic start [<ticket_id>] [--sops=<names_or_indices>] [--auto-judge]`\n - *Description:* Attributes token costs to a ticket (optional) and scopes active local SOP directories for governance.\n - *Examples:*\n * `@intutic start 1 --sops=3 --auto-judge`\n * `@intutic start --sops=security-rules --auto-judge`\n\n### 2. FinOps & Token Projections\n- **Predict Costs:** `@intutic predict <prompt>`\n - *Description:* Estimates input/output tokens and cost breakdown before submitting the request to the upstream model.\n- **Optimize Context:** `@intutic recommend`\n - *Description:* Provides recommendations on prompt adjustments and context reduction strategies to minimize token waste.\n\n### 3. Policy Compliance & E2E Judging\n- **Verify Prompt:** `@intutic verify <prompt>` (or `@intutic check <prompt>`)\n - *Description:* Audits the prompt pre-flight against active SOPs and guidelines, returning pass/fail verdicts and listing any violations before submitting requests to the LLM.\n- **Review Prompt:** `@intutic review <prompt>`\n - *Description:* Quick heuristic check that grades the prompt on its length, its use of action verbs, and whether it names an SOP or policy, with suggestions. No model is involved.\n- **Judge Response:** `@intutic judge <prompt>`\n - *Description:* Submits the prompt to the upstream LLM and evaluates the response stream in parallel using LLM-as-a-judge compliance checkers.\n - *Note:* If no prompt is provided (e.g. `@intutic judge`), returns usage instructions.\n- **Inspect Status:** `@intutic status` (displays active session stats, average compliance, and spent budget).\n- **Inspect Budget:** `@intutic budget` (displays daily monitored limits and workspace progress).\n\n### 4. Posture & Prompt Enhancement\n- **Enhance & Diagnose:** `/fix <prompt>` (aliases: `@fix`, `/intutic-fix`, `@intutic fix`)\n - *Description:* Rewrites the prompt and scores the workspace's governance posture against OWASP categories from what the proxy can see locally \u2014 DLP settings, WASM rules, the SOPs on disk for the caller's role, skills and MCP servers. Returns the enhanced prompt plus concrete recommendations for whatever is missing.\n - *Note:* Blocking by default; it can be configured to pass the enhanced prompt through to the model instead. The recommendations are the handoff points into the rest of the toolchain \u2014 \"add a WASM rule\" is the `intutic-rule-author` skill's job, \"write a role SOP\" and \"enable DLP\" are handled here.\n- **Draw Guardrails:** `/draw` (aliases: `@draw`, `/intutic-draw`, `@intutic draw`)\n - *Description:* Renders a Mermaid diagram plus text summary of the agent's trajectory and the guardrails currently around it. Always blocking \u2014 a visualization has nothing to forward upstream.\n\n---\n\n## \uD83D\uDEA6 When a Call Is Refused or Held\n\nIntutic names every refusal with a code: an SDK raises it (`ClawdeBlockedError.code`, `IntuticGateRefusal.code`), the MCP proxy puts it in `error.data.code`, a hook gate that answers in JSON (Cline, Grok Build, Antigravity) puts it in `code` beside `ruleId`, and the proxy names a withheld answer in its `x-intutic-refusal` header. A refusal you read as text, starting `[Intutic]` or `[Intutic Governance]`, is the same refusal: the call it names did not run (unless it says the result was withheld). Find the code below and act on it.\n\n### Held: tell the user, then wait\nA hold rule wants a person to see this call before it runs. Codes: `HELD` (with a hold id, `hold_\u2026`), a hook gate's `[Intutic Governance] HELD:` message, `LOOP_RUN_PENDING_REVIEW` (the loop run is paused for review), and the proxy's `policy_held` (a Rego or WASM rule held the request; the error names the hold id). `SERVER_HELD` is the MCP registry's version: the server changed its tools in a risky way and waits for an owner or admin on the MCP Servers page.\n- Tell the user what was held and quote the hold id.\n- Only an **Owner, Admin or Engineering Manager** can decide it, on a control plane: `intutic decision approve <holdId>` or `intutic decision reject <holdId>`, the review queue, or the Slack card. A developer cannot approve their own hold. With no control plane a hold cannot be approved: the call stays refused.\n- Do not retry while it is pending. After approval, the identical call (same tool, same arguments) passes only if the workspace's review-hold bypass (`reviewHoldBypassEnabled`) is on, and only for a short window (10 minutes by default); otherwise approval records the decision and a retry is held again. The `intutic_hold_status` MCP tool says which.\n- A hold with no hold id could not be recorded, so there is nothing to approve: tell the user.\n\n### Revise: change the approach\n`policy_reask` (proxy) and `REASK` (MCP proxy) refuse this attempt with a reason. Do something different; repeating it becomes a block (`policy_denied`, `REASK_EXHAUSTED`).\n\n### Blocked: do not retry the same call\nContinue without it, or tell the user what would have to change and who can change it.\n- **Policy:** `policy_denied`, `TOOL_DENIED`, `SOP_RULE`, `SNAPSHOT`, `HOOK_GATE`, `ANOMALY`, `WASM_RULE`, `REASK_EXHAUSTED`, `LOOP_RUN_TERMINATED`, `model_not_allowed`.\n- **Protected by the hook gate:** `BUILT_IN_RULE`: a governance bypass, a write to Intutic's own config or a skill directory, or a secret in written content. Do not look for another route to the same change; tell the user.\n- **Identity:** `SSO_GROUP`: the user's SSO groups do not clear this tool (rule `sso_group.high_risk.<tool>` or `sso_group.require_obo.<tool>`). An admin grants the group; you cannot work around it.\n- **Data:** `dlp_policy_violation` and `DLP` (a secret, destructive command or PII value in the input: remove it), `INJECTION` (the input carries a prompt-injection pattern), `SQL_GUARD` (destructive SQL against a database not on the SQL allowlist: use an allowlisted database, named explicitly on the command line).\n- **MCP servers:** `SERVER_BLOCKED`, `SERVER_NOT_APPROVED`, `TOOL_DISABLED`, `SERVER_NOT_ALLOWED`, `TOOL_NOT_ALLOWED`, `TOOL_DEFINITIONS_CHANGED`. An owner or admin decides on the MCP Servers page; the `intutic_mcp_registry_status` MCP tool shows what the registry says.\n- **Spend:** `BUDGET_EXCEEDED`, `OVERAGE_HARD_CAP_EXCEEDED`, `COST_GATE_EXCEEDED` (a smaller request may pass). A proxy `BUDGET_EXCEEDED` names the budget (the workspace's, your key's or yours) and its `Retry-After` is when it resets; an MCP `BUDGET_EXCEEDED` lasts until its `resetAt`, and `intutic_mcp_budget_remaining` shows what is left. `RATE_LIMITED`: your key's requests or tokens per minute are used up; wait the `Retry-After` seconds, then continue.\n- **Images:** `E_UNPINNED_LATEST`, `E_UNPINNED_TAG`, `E_UNKNOWN_REGISTRY`, `E_UNKNOWN_IMAGE`, `E_DIGEST_MISMATCH`, `E_MANIFEST_UNPARSEABLE`: deploy an image pinned to a digest the image allowlist approves.\n- **Gate setup:** `WORKFLOW_SANDBOX`, `NO_GATE`: the gate is wired wrongly in the agent's code; fix the code, not the call. `UNREADABLE_CALL`: the hook could not read the tool call from its harness, which is a setup fault to report, not something to retry. `INVALID_REQUEST`: the control plane's hook gate could not read the request a gate SDK or interceptor sent it (not JSON, or no tool name), and a gate refuses that whatever its fail-open setting; the SDK's refusal reads `HOOK_GATE` with `INVALID_REQUEST` in its reason. The call did not run and the same request is refused again, so do not retry: report the integration fault to the user. `INSUFFICIENT_SCOPE`: the API key lacks the scope the call needs (`gateway:use` for the hook gate); retrying cannot help, so tell the user, who gives the key the scope.\n- **Custom rule could not decide:** `GOVERNANCE_UNAVAILABLE` whose reason names a custom rule (`Custom rule <id> reached no verdict (<cause>)`, rule id `wasm:<id>`; cause `deadline`, `budget`, `error`, `result` or `quarantined`). The rule cannot decide this input, so the same call is refused again however often it is retried. Do not retry it; tell the user, who can fix or remove the rule.\n- **Size:** `COMMAND_TOO_LARGE`: the command is over 256 KiB, or the tool's arguments over 1 MiB, more than any gate evaluates. Split the work: smaller commands, or a file written in parts. A hook gate that could not finish deciding in time says `GATE_DEADLINE` in its reason; the call did not run, and the same call will be refused again, so tell the user.\n\n### Not checked: retry once, later\n`GOVERNANCE_UNAVAILABLE` (unless it names a custom rule: see above), `REGISTRY_UNAVAILABLE`, `BUDGET_UNAVAILABLE`, `TOFU_UNAVAILABLE`, `RESPONSE_UNPARSEABLE`, `GATE_CRASHED` (the hook gate failed while deciding), `POLICY_SNAPSHOT_UNVERIFIED` (the policy snapshot on this machine failed its integrity check, so no MCP call runs until the sync daemon restores it), and `HOOK_GATE` when its reason says the control plane was unreachable or a governance check was unavailable: governance could not check the call, so it did not run. One later retry is fine; if it fails again, tell the user.\n\n### Ran, but the result was withheld\n`RESULT_WITHHELD_DLP`, `RESULT_WITHHELD_INJECTION` (MCP proxy) and `OUTPUT_DLP` (proxy): the tool or model ran, and its output was not delivered. Do not run it again blindly, since it may already have had its effect; tell the user.\n\n### Injected by an experiment\n`CHAOS_FAULT`: a resilience experiment (`intutic chaos run`) failed this call on purpose, or could not start because its plan was unreadable. The reason is the failure it imitates and carries an `E-INTUTIC-` token: handle it as that failure, and tell the user what failed, quoting the token.\n\n---\n\n## \uD83D\uDEE1\uFE0F Policy & Hook Verification\n\n1. **Pre-Tool Interception Hooks:**\n Harness configurations (e.g. `.claude/settings.json`, `.cursor/hooks.json`) are written by `intutic gates install`. They register execution hooks that block unauthorized tools or unsafe commands before execution.\n2. **Local Guidelines & Scoping:**\n Define local, developer-specific rules inside subdirectories of the `.intutic/sops/` directory (e.g. `.intutic/sops/my-rules/rules.md`). Initialize them using `@intutic initialize` and select active local SOPs using `@intutic start <ticket> --sops=<indices_or_names>`. These rules are enforced locally in the developer console to protect developer privacy, while global/corporate rules log incidents back to the control plane.\n3. **Offline Sync & Promotion:**\n When offline, prompt telemetry is stored locally in sharded files `~/.intutic/logs/traces-YYYY-MM-DD.jsonl` and budgets are enforced against sharded daily files `~/.intutic/logs/local-spend-YYYY-MM-DD.jsonl`. With a control plane, the sync daemon uploads them via `/api/v1/traces/sync-back` and cleans up the local files, and rules can be promoted workspace-wide.\n";
31
+ export declare const KITKAT_SKILL = "---\nname: intutic-governance-kitkat\ndescription: Guide and execute Intutic governed developer workflows, ticket cost attributions, pre-flight token predictions, and safety policy interceptions using the Kitkat persona.\n---\n\n# \uD83D\uDC31 Kitkat \u2014 Intutic Agentic Governance Skill\n\nHello! I am **Kitkat**, your friendly agentic control plane assistant for the Intutic Governance Engine. I ensure that your AI agentic workflows are safe, structured, FinOps-optimized, and compliant with both global enterprise policies (Notion/Confluence) and local rules.\n\n---\n\n## \uD83D\uDEE0\uFE0F CLI Reference Catalog\n\nUse the `intutic` CLI commands to manage the daemon, inspect execution traces, or manage governed task loops in your workspace:\n\n### 1. Connection & Session Setup\n- **Initialize Workspace:** `intutic init` (detects the developer harnesses in the workspace, like Claude Code or Cursor, and records them in `~/.intutic/config.json`).\n- **Install Gates:** `intutic gates install [--harness <id>] [--route] [--dry-run]` (writes each recorded harness's blocking hooks, and its rules file from the local SOPs in `.intutic/sops/`, with no control plane; `--route` also points the harnesses at the local proxy, which must then be running).\n- **Start the Proxy:** `intutic start` (boots the local interceptor proxy, and refreshes installed gates at start and whenever `.intutic/sops/` changes).\n- **Stop Governing:** `intutic disconnect [--harness <id>] [--dry-run] [--keep-login]` (restores every harness config Intutic changed and removes its hooks). Run it only when the user asks; `--dry-run` shows what would change.\n\n### 2. Traces & Auditing\n- **Check Budget:** `intutic budget` (displays the local daily spend cap and today's spend; with a control plane, the workspace limits too).\n- **List Sessions:** `intutic traces list`\n- **Inspect Session Trace:** `intutic traces inspect <trace_id>`\n\n### 3. Governed Task Loops (control plane only)\n- **Start Task Loop:** `intutic loop start --name <name> [--budget <USD>] [--sops <indices_or_names>] [--auto-judge]`\n- **Execute Wrapped Agent:** `intutic loop exec --name <name> [--budget <USD>] [--sops <indices_or_names>] [--auto-judge] -- <command>`\n- **Complete/Kill Loop:** `intutic loop complete <loopRunId>` / `intutic loop kill <loopRunId>`\n- **List Active Loops:** `intutic loop list`\n\n---\n\n## \uD83D\uDD0C Interception & Command Prepends\n\nWhen interacting with LLM providers through the local proxy, prepend requests with `@intutic` (or `/intutic`) to control the active governance session:\n\n### 1. Cost & Task Attribution\n- **Initialize Picker:** `@intutic initialize`\n - *Description:* Lists the open tickets on the workspace's Jira and Linear connections, numbered, and marks the one the current git branch names as Recommended.\n- **Lock Session & Scope Rules:** `@intutic start [<ticket_id>] [--sops=<names_or_indices>] [--auto-judge]`\n - *Description:* Attributes token costs to a ticket (optional) and scopes active local SOP directories for governance.\n - *Examples:*\n * `@intutic start 1 --sops=3 --auto-judge`\n * `@intutic start --sops=security-rules --auto-judge`\n\n### 2. FinOps & Token Projections\n- **Predict Costs:** `@intutic predict <prompt>`\n - *Description:* Estimates input/output tokens and cost breakdown before submitting the request to the upstream model.\n- **Optimize Context:** `@intutic recommend`\n - *Description:* Provides recommendations on prompt adjustments and context reduction strategies to minimize token waste.\n\n### 3. Policy Compliance & E2E Judging\n- **Verify Prompt:** `@intutic verify <prompt>` (or `@intutic check <prompt>`)\n - *Description:* Audits the prompt pre-flight against active SOPs and guidelines, returning pass/fail verdicts and listing any violations before submitting requests to the LLM.\n- **Review Prompt:** `@intutic review <prompt>`\n - *Description:* Quick heuristic check that grades the prompt on its length, its use of action verbs, and whether it names an SOP or policy, with suggestions. No model is involved.\n- **Judge Response:** `@intutic judge <prompt>`\n - *Description:* Submits the prompt to the upstream LLM and evaluates the response stream in parallel using LLM-as-a-judge compliance checkers.\n - *Note:* If no prompt is provided (e.g. `@intutic judge`), returns usage instructions.\n- **Inspect Status:** `@intutic status` (displays active session stats, average compliance, and spent budget).\n- **Inspect Budget:** `@intutic budget` (displays daily monitored limits and workspace progress).\n\n### 4. Posture & Prompt Enhancement\n- **Enhance & Diagnose:** `/fix <prompt>` (aliases: `@fix`, `/intutic-fix`, `@intutic fix`)\n - *Description:* Rewrites the prompt and scores the workspace's governance posture against OWASP categories from what the proxy can see locally \u2014 DLP settings, WASM rules, the SOPs on disk for the caller's role, skills and MCP servers. Returns the enhanced prompt plus concrete recommendations for whatever is missing.\n - *Note:* Blocking by default; it can be configured to pass the enhanced prompt through to the model instead. The recommendations are the handoff points into the rest of the toolchain \u2014 \"add a WASM rule\" is the `intutic-rule-author` skill's job, \"write a role SOP\" and \"enable DLP\" are handled here.\n- **Draw Guardrails:** `/draw` (aliases: `@draw`, `/intutic-draw`, `@intutic draw`)\n - *Description:* Renders a Mermaid diagram plus text summary of the agent's trajectory and the guardrails currently around it. Always blocking \u2014 a visualization has nothing to forward upstream.\n\n---\n\n## \uD83D\uDEA6 When a Call Is Refused or Held\n\nIntutic names every refusal with a code: an SDK raises it (`ClawdeBlockedError.code`, `IntuticGateRefusal.code`), the MCP proxy puts it in `error.data.code`, a hook gate that answers in JSON (Cline, Grok Build, Antigravity) puts it in `code` beside `ruleId`, and the proxy names a withheld answer in its `x-intutic-refusal` header. A refusal you read as text, starting `[Intutic]` or `[Intutic Governance]`, is the same refusal: the call it names did not run (unless it says the result was withheld). Find the code below and act on it.\n\n### Held: tell the user, then wait\nA hold rule wants a person to see this call before it runs. Codes: `HELD` (with a hold id, `hold_\u2026`), a hook gate's `[Intutic Governance] HELD:` message, `LOOP_RUN_PENDING_REVIEW` (the loop run is paused for review), and the proxy's `policy_held` (a Rego or WASM rule held the request; the error names the hold id). `SERVER_HELD` is the MCP registry's version: the server changed its tools in a risky way and waits for an owner or admin on the MCP Servers page.\n- Tell the user what was held and quote the hold id.\n- Only an **Owner, Admin or Engineering Manager** can decide it, on a control plane: `intutic decision approve <holdId>` or `intutic decision reject <holdId>`, the review queue, or the Slack card. A developer cannot approve their own hold. With no control plane a hold cannot be approved: the call stays refused.\n- Do not retry while it is pending. After approval, the identical call (same tool, same arguments) passes only if the workspace's review-hold bypass (`reviewHoldBypassEnabled`) is on, and only for a short window (10 minutes by default); otherwise approval records the decision and a retry is held again. The `intutic_hold_status` MCP tool says which.\n- A hold with no hold id could not be recorded, so there is nothing to approve: tell the user.\n\n### Revise: change the approach\n`policy_reask` (proxy) and `REASK` (MCP proxy) refuse this attempt with a reason. Do something different; repeating it becomes a block (`policy_denied`, `REASK_EXHAUSTED`).\n\nA refusal that says where it applies carries `scope` (paths, tools, a step) and, at a hook gate that reads exit codes, a `[Intutic] Retry scope:` line; retry outside it.\n- `PREREQUISITE_UNMET`: the call needs a passing test run first (`requires_before: action:run_tests[ok]`), and the session has none, the last one failed or could not be read, or files changed since. Run the tests, make them pass, then retry. Where the reason says the harness reports no tool results, no run can count here: tell the user.\n- `OUT_OF_SCOPE`: the change targets a path outside the SOP's `scope_paths`. Change only files inside the scope, or tell the user the task needs a wider one.\n- `PLAN_NOT_APPROVED`: the session's plan is not approved yet. Write the plan and wait for its approval; reads are still allowed. `OFF_PLAN`: the tool is not a step of the approved plan; use a planned step, or get the plan changed.\n- `NODE_KIND_DENIED`: this agent's graph node may not do this (a `code` node made a model call, or a child of a `worker` or `gate` node did). Hand the work to a node allowed to do it.\n\n### Blocked: do not retry the same call\nContinue without it, or tell the user what would have to change and who can change it.\n- **Policy:** `policy_denied`, `TOOL_DENIED`, `SOP_RULE`, `SNAPSHOT`, `HOOK_GATE`, `ANOMALY`, `WASM_RULE`, `REASK_EXHAUSTED`, `LOOP_RUN_TERMINATED`, `model_not_allowed`.\n- **Protected by the hook gate:** `BUILT_IN_RULE`: a governance bypass, a write to Intutic's own config or a skill directory, or a secret in written content. Do not look for another route to the same change; tell the user.\n- **Identity:** `SSO_GROUP`: the user's SSO groups do not clear this tool (rule `sso_group.high_risk.<tool>` or `sso_group.require_obo.<tool>`). An admin grants the group; you cannot work around it.\n- **Data:** `dlp_policy_violation` and `DLP` (a secret, destructive command or PII value in the input: remove it), `INJECTION` (the input carries a prompt-injection pattern), `SQL_GUARD` (destructive SQL against a database not on the SQL allowlist: use an allowlisted database, named explicitly on the command line).\n- **MCP servers:** `SERVER_BLOCKED`, `SERVER_NOT_APPROVED`, `TOOL_DISABLED`, `SERVER_NOT_ALLOWED`, `TOOL_NOT_ALLOWED`, `TOOL_DEFINITIONS_CHANGED`. An owner or admin decides on the MCP Servers page; the `intutic_mcp_registry_status` MCP tool shows what the registry says.\n- **Spend:** `BUDGET_EXCEEDED`, `OVERAGE_HARD_CAP_EXCEEDED`, `COST_GATE_EXCEEDED` (a smaller request may pass). A proxy `BUDGET_EXCEEDED` names the budget (the workspace's, your key's or yours) and its `Retry-After` is when it resets; an MCP `BUDGET_EXCEEDED` lasts until its `resetAt`, and `intutic_mcp_budget_remaining` shows what is left. `RATE_LIMITED`: your key's requests or tokens per minute are used up; wait the `Retry-After` seconds, then continue.\n- **Images:** `E_UNPINNED_LATEST`, `E_UNPINNED_TAG`, `E_UNKNOWN_REGISTRY`, `E_UNKNOWN_IMAGE`, `E_DIGEST_MISMATCH`, `E_MANIFEST_UNPARSEABLE`: deploy an image pinned to a digest the image allowlist approves.\n- **Gate setup:** `WORKFLOW_SANDBOX`, `NO_GATE`: the gate is wired wrongly in the agent's code; fix the code, not the call. `UNREADABLE_CALL`: the hook could not read the tool call from its harness, which is a setup fault to report, not something to retry. `INVALID_REQUEST`: the control plane's hook gate could not read the request a gate SDK or interceptor sent it (not JSON, or no tool name), and a gate refuses that whatever its fail-open setting; the SDK's refusal reads `HOOK_GATE` with `INVALID_REQUEST` in its reason. The call did not run and the same request is refused again, so do not retry: report the integration fault to the user. `INSUFFICIENT_SCOPE`: the API key lacks the scope the call needs (`gateway:use` for the hook gate); retrying cannot help, so tell the user, who gives the key the scope.\n- **Custom rule could not decide:** `GOVERNANCE_UNAVAILABLE` whose reason names a custom rule (`Custom rule <id> reached no verdict (<cause>)`, rule id `wasm:<id>`; cause `deadline`, `budget`, `error`, `result` or `quarantined`). The rule cannot decide this input, so the same call is refused again however often it is retried. Do not retry it; tell the user, who can fix or remove the rule.\n- **Decision rules:** `DECIDE_REFUSED`: a decide rule asked a self-hosted model about this call and the answers say it breaks the rule. The same call is refused again; change the approach or tell the user. `DECIDE_ESCALATED`: the model was unsure and this harness cannot ask the user, so the call needs a person: tell the user what you were about to do and why, and let them decide. A `GOVERNANCE_UNAVAILABLE` from a decide rule (rule id `decide.<rule>`) means its model could not answer: handle it as below.\n- **Size:** `COMMAND_TOO_LARGE`: the command is over 256 KiB, or the tool's arguments over 1 MiB, more than any gate evaluates. Split the work: smaller commands, or a file written in parts. A hook gate that could not finish deciding in time says `GATE_DEADLINE` in its reason; the call did not run, and the same call will be refused again, so tell the user.\n\n### Not checked: retry once, later\n`GOVERNANCE_UNAVAILABLE` (unless it names a custom rule: see above), `REGISTRY_UNAVAILABLE`, `BUDGET_UNAVAILABLE`, `TOFU_UNAVAILABLE`, `RESPONSE_UNPARSEABLE`, `GATE_CRASHED` (the hook gate failed while deciding), `POLICY_SNAPSHOT_UNVERIFIED` (the policy snapshot on this machine failed its integrity check, so no MCP call runs until the sync daemon restores it), and `HOOK_GATE` when its reason says the control plane was unreachable or a governance check was unavailable: governance could not check the call, so it did not run. One later retry is fine; if it fails again, tell the user.\n\n### Ran, but the result was withheld\n`RESULT_WITHHELD_DLP`, `RESULT_WITHHELD_INJECTION` (MCP proxy) and `OUTPUT_DLP` (proxy): the tool or model ran, and its output was not delivered. Do not run it again blindly, since it may already have had its effect; tell the user.\n\n### Injected by an experiment\n`CHAOS_FAULT`: a resilience experiment (`intutic chaos run`) failed this call on purpose, or could not start because its plan was unreadable. The reason is the failure it imitates and carries an `E-INTUTIC-` token: handle it as that failure, and tell the user what failed, quoting the token.\n\n---\n\n## \uD83D\uDEE1\uFE0F Policy & Hook Verification\n\n1. **Pre-Tool Interception Hooks:**\n Harness configurations (e.g. `.claude/settings.json`, `.cursor/hooks.json`) are written by `intutic gates install`. They register execution hooks that block unauthorized tools or unsafe commands before execution.\n2. **Local Guidelines & Scoping:**\n Define local, developer-specific rules inside subdirectories of the `.intutic/sops/` directory (e.g. `.intutic/sops/my-rules/rules.md`). Initialize them using `@intutic initialize` and select active local SOPs using `@intutic start <ticket> --sops=<indices_or_names>`. These rules are enforced locally in the developer console to protect developer privacy, while global/corporate rules log incidents back to the control plane.\n3. **Offline Sync & Promotion:**\n When offline, prompt telemetry is stored locally in sharded files `~/.intutic/logs/traces-YYYY-MM-DD.jsonl` and budgets are enforced against sharded daily files `~/.intutic/logs/local-spend-YYYY-MM-DD.jsonl`. With a control plane, the sync daemon uploads them via `/api/v1/traces/sync-back` and cleans up the local files, and rules can be promoted workspace-wide.\n";
32
32
  /** Every skill connect writes, by workspace-relative path. */
33
33
  export declare const BUNDLED_SKILLS: ReadonlyArray<{
34
34
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"skillWriter.d.ts","sourceRoot":"","sources":["../src/skillWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,QAKlC,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,ykLA2E7B,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,QAA+E,CAAA;AAE7G,sFAAsF;AACtF,eAAO,MAAM,YAAY,y7aAuHxB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAG3E,CAAA;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBjF"}
1
+ {"version":3,"file":"skillWriter.d.ts","sourceRoot":"","sources":["../src/skillWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,QAKlC,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,ykLA2E7B,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,QAA+E,CAAA;AAE7G,sFAAsF;AACtF,eAAO,MAAM,YAAY,y/dA8HxB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAG3E,CAAA;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBjF"}
@@ -194,6 +194,12 @@ A hold rule wants a person to see this call before it runs. Codes: \`HELD\` (wit
194
194
  ### Revise: change the approach
195
195
  \`policy_reask\` (proxy) and \`REASK\` (MCP proxy) refuse this attempt with a reason. Do something different; repeating it becomes a block (\`policy_denied\`, \`REASK_EXHAUSTED\`).
196
196
 
197
+ A refusal that says where it applies carries \`scope\` (paths, tools, a step) and, at a hook gate that reads exit codes, a \`[Intutic] Retry scope:\` line; retry outside it.
198
+ - \`PREREQUISITE_UNMET\`: the call needs a passing test run first (\`requires_before: action:run_tests[ok]\`), and the session has none, the last one failed or could not be read, or files changed since. Run the tests, make them pass, then retry. Where the reason says the harness reports no tool results, no run can count here: tell the user.
199
+ - \`OUT_OF_SCOPE\`: the change targets a path outside the SOP's \`scope_paths\`. Change only files inside the scope, or tell the user the task needs a wider one.
200
+ - \`PLAN_NOT_APPROVED\`: the session's plan is not approved yet. Write the plan and wait for its approval; reads are still allowed. \`OFF_PLAN\`: the tool is not a step of the approved plan; use a planned step, or get the plan changed.
201
+ - \`NODE_KIND_DENIED\`: this agent's graph node may not do this (a \`code\` node made a model call, or a child of a \`worker\` or \`gate\` node did). Hand the work to a node allowed to do it.
202
+
197
203
  ### Blocked: do not retry the same call
198
204
  Continue without it, or tell the user what would have to change and who can change it.
199
205
  - **Policy:** \`policy_denied\`, \`TOOL_DENIED\`, \`SOP_RULE\`, \`SNAPSHOT\`, \`HOOK_GATE\`, \`ANOMALY\`, \`WASM_RULE\`, \`REASK_EXHAUSTED\`, \`LOOP_RUN_TERMINATED\`, \`model_not_allowed\`.
@@ -205,6 +211,7 @@ Continue without it, or tell the user what would have to change and who can chan
205
211
  - **Images:** \`E_UNPINNED_LATEST\`, \`E_UNPINNED_TAG\`, \`E_UNKNOWN_REGISTRY\`, \`E_UNKNOWN_IMAGE\`, \`E_DIGEST_MISMATCH\`, \`E_MANIFEST_UNPARSEABLE\`: deploy an image pinned to a digest the image allowlist approves.
206
212
  - **Gate setup:** \`WORKFLOW_SANDBOX\`, \`NO_GATE\`: the gate is wired wrongly in the agent's code; fix the code, not the call. \`UNREADABLE_CALL\`: the hook could not read the tool call from its harness, which is a setup fault to report, not something to retry. \`INVALID_REQUEST\`: the control plane's hook gate could not read the request a gate SDK or interceptor sent it (not JSON, or no tool name), and a gate refuses that whatever its fail-open setting; the SDK's refusal reads \`HOOK_GATE\` with \`INVALID_REQUEST\` in its reason. The call did not run and the same request is refused again, so do not retry: report the integration fault to the user. \`INSUFFICIENT_SCOPE\`: the API key lacks the scope the call needs (\`gateway:use\` for the hook gate); retrying cannot help, so tell the user, who gives the key the scope.
207
213
  - **Custom rule could not decide:** \`GOVERNANCE_UNAVAILABLE\` whose reason names a custom rule (\`Custom rule <id> reached no verdict (<cause>)\`, rule id \`wasm:<id>\`; cause \`deadline\`, \`budget\`, \`error\`, \`result\` or \`quarantined\`). The rule cannot decide this input, so the same call is refused again however often it is retried. Do not retry it; tell the user, who can fix or remove the rule.
214
+ - **Decision rules:** \`DECIDE_REFUSED\`: a decide rule asked a self-hosted model about this call and the answers say it breaks the rule. The same call is refused again; change the approach or tell the user. \`DECIDE_ESCALATED\`: the model was unsure and this harness cannot ask the user, so the call needs a person: tell the user what you were about to do and why, and let them decide. A \`GOVERNANCE_UNAVAILABLE\` from a decide rule (rule id \`decide.<rule>\`) means its model could not answer: handle it as below.
208
215
  - **Size:** \`COMMAND_TOO_LARGE\`: the command is over 256 KiB, or the tool's arguments over 1 MiB, more than any gate evaluates. Split the work: smaller commands, or a file written in parts. A hook gate that could not finish deciding in time says \`GATE_DEADLINE\` in its reason; the call did not run, and the same call will be refused again, so tell the user.
209
216
 
210
217
  ### Not checked: retry once, later
@@ -1 +1 @@
1
- {"version":3,"file":"skillWriter.js","sourceRoot":"","s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e,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -64,7 +64,18 @@ export interface GateCacheRefreshOptions {
64
64
  workspaceId: string;
65
65
  /** See {@link PolicySnapshotOptions.localHoldTokens}. */
66
66
  localHoldTokens?: readonly string[];
67
+ /** See {@link PolicySnapshotOptions.localSops}: {@link localGateSopsFor}. */
68
+ localSops?: readonly SyncSopEntry[];
69
+ /** The sync interval, which the approved-plans cache must outlive (three of them). */
70
+ syncIntervalMs?: number;
67
71
  }
72
+ /**
73
+ * The local SOPs whose `@rule` records and lane holds the snapshot carries:
74
+ * every one in `.intutic/sops`, whatever the session selected, as
75
+ * for the review holds. The synced SOPs are not among them: the control
76
+ * plane compiles theirs (`gateRecords`, `holdRules`).
77
+ */
78
+ export declare function localGateSopsFor(workspaceRoot: string, harnesses?: HarnessType[]): Promise<SyncSopEntry[]>;
68
79
  /**
69
80
  * The `review_before:` tokens the snapshot compiles into hold rules: from the
70
81
  * synced SOPs' front matter and JSON blocks, the workspace settings, and the
@@ -73,9 +84,10 @@ export interface GateCacheRefreshOptions {
73
84
  */
74
85
  export declare function localHoldTokensFor(workspaceRoot: string, sops: SyncSopEntry[], settings: Record<string, unknown> | undefined, harnesses?: HarnessType[]): Promise<string[]>;
75
86
  /**
76
- * Refresh the three gate-side caches every hook reads: the policy snapshot
87
+ * Refresh the gate-side caches every hook reads: the policy snapshot
77
88
  * (`~/.intutic/hooks/policy-snapshot.rules`), the approved review-hold
78
- * bypasses and the central egress policy. Called on EVERY sync cycle, never
89
+ * bypasses, the approved plans (`plan_approval:`) and the central egress
90
+ * policy. Called on EVERY sync cycle, never
79
91
  * only when the config version moved: policy changes without the version
80
92
  * changing, and before this helper existed `connect` refreshed once at
81
93
  * startup and never again, so a guardrail promoted mid-session reached a
@@ -85,6 +97,7 @@ export declare function localHoldTokensFor(workspaceRoot: string, sops: SyncSopE
85
97
  export declare function refreshGateCaches(opts: GateCacheRefreshOptions): Promise<{
86
98
  snapshot: boolean;
87
99
  bypasses: boolean;
100
+ plans: boolean;
88
101
  egress: boolean;
89
102
  }>;
90
103
  /** Where the ids of SkillOpt suggestions that fully landed are remembered. */
@@ -1 +1 @@
1
- {"version":3,"file":"syncCycle.d.ts","sourceRoot":"","sources":["../src/syncCycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAGzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAK/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAAmC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAStF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;IACxB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;IACvC;;;2EAGuE;IACvE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,GAAG,IAAI,CAkCP;AAED,qDAAqD;AACrD,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAC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EAAE,OAAO,CAAA;IAC1B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC,GAAG,OAAO,CAAC;IACV,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAA;IACxE,QAAQ,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzD,CAAC,CA6CD;AAED,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqE9F"}
package/dist/syncCycle.js CHANGED
@@ -27,6 +27,7 @@ import { applyConfigEdits, loadLocalSopEntries } from './configWriter.js';
27
27
  import { parseSopConstraints } from './harness/claudeCodeHooks.js';
28
28
  import { refreshPolicySnapshot } from './lib/policySnapshot.js';
29
29
  import { refreshApprovedBypasses } from './lib/approvedBypasses.js';
30
+ import { refreshApprovedPlans } from './lib/approvedPlans.js';
30
31
  import { refreshEgressPolicy } from './lib/egressPolicy.js';
31
32
  import { collectAgentReport, reportAgent } from './agentReporter.js';
32
33
  import { startHarnessSession } from './sessionReporter.js';
@@ -96,6 +97,15 @@ export function emitSkillFlaggedEvents(opts) {
96
97
  }
97
98
  }
98
99
  }
100
+ /**
101
+ * The local SOPs whose `@rule` records and lane holds the snapshot carries:
102
+ * every one in `.intutic/sops`, whatever the session selected, as
103
+ * for the review holds. The synced SOPs are not among them: the control
104
+ * plane compiles theirs (`gateRecords`, `holdRules`).
105
+ */
106
+ export async function localGateSopsFor(workspaceRoot, harnesses = []) {
107
+ return loadLocalSopEntries(workspaceRoot, harnesses, { ignoreSelection: true });
108
+ }
99
109
  /**
100
110
  * The `review_before:` tokens the snapshot compiles into hold rules: from the
101
111
  * synced SOPs' front matter and JSON blocks, the workspace settings, and the
@@ -108,9 +118,10 @@ export async function localHoldTokensFor(workspaceRoot, sops, settings, harnesse
108
118
  return parseSopConstraints([...sops, ...local], settings).reviewBefore;
109
119
  }
110
120
  /**
111
- * Refresh the three gate-side caches every hook reads: the policy snapshot
121
+ * Refresh the gate-side caches every hook reads: the policy snapshot
112
122
  * (`~/.intutic/hooks/policy-snapshot.rules`), the approved review-hold
113
- * bypasses and the central egress policy. Called on EVERY sync cycle, never
123
+ * bypasses, the approved plans (`plan_approval:`) and the central egress
124
+ * policy. Called on EVERY sync cycle, never
114
125
  * only when the config version moved: policy changes without the version
115
126
  * changing, and before this helper existed `connect` refreshed once at
116
127
  * startup and never again, so a guardrail promoted mid-session reached a
@@ -120,8 +131,9 @@ export async function localHoldTokensFor(workspaceRoot, sops, settings, harnesse
120
131
  export async function refreshGateCaches(opts) {
121
132
  const snapshot = (await refreshPolicySnapshot(opts)) !== null;
122
133
  const bypasses = (await refreshApprovedBypasses(opts)) !== null;
134
+ const plans = (await refreshApprovedPlans(opts)) !== null;
123
135
  const egress = (await refreshEgressPolicy(opts)) !== null;
124
- return { snapshot, bypasses, egress };
136
+ return { snapshot, bypasses, plans, egress };
125
137
  }
126
138
  /** Where the ids of SkillOpt suggestions that fully landed are remembered. */
127
139
  export const APPLIED_SUGGESTIONS_RELATIVE_PATH = path.join('.intutic', 'applied-suggestions.json');
@@ -1 +1 @@
1
- {"version":3,"file":"syncCycle.js","sourceRoot":"","sources":["../src/syncCycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,mBAAm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