@intutic/sync-daemon 2.1.0 → 2.3.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 (288) hide show
  1. package/README.md +1 -1
  2. package/dist/agentReporter.d.ts +24 -11
  3. package/dist/agentReporter.d.ts.map +1 -1
  4. package/dist/agentReporter.js +20 -13
  5. package/dist/agentReporter.js.map +1 -1
  6. package/dist/configReader.d.ts +45 -25
  7. package/dist/configReader.d.ts.map +1 -1
  8. package/dist/configReader.js +70 -46
  9. package/dist/configReader.js.map +1 -1
  10. package/dist/configWriter.d.ts +32 -45
  11. package/dist/configWriter.d.ts.map +1 -1
  12. package/dist/configWriter.js +52 -686
  13. package/dist/configWriter.js.map +1 -1
  14. package/dist/disconnect/harnesses.d.ts +29 -0
  15. package/dist/disconnect/harnesses.d.ts.map +1 -0
  16. package/dist/disconnect/harnesses.js +805 -0
  17. package/dist/disconnect/harnesses.js.map +1 -0
  18. package/dist/disconnect/index.d.ts +25 -0
  19. package/dist/disconnect/index.d.ts.map +1 -0
  20. package/dist/disconnect/index.js +92 -0
  21. package/dist/disconnect/index.js.map +1 -0
  22. package/dist/disconnect/mcp.d.ts +81 -0
  23. package/dist/disconnect/mcp.d.ts.map +1 -0
  24. package/dist/disconnect/mcp.js +354 -0
  25. package/dist/disconnect/mcp.js.map +1 -0
  26. package/dist/disconnect/originals.d.ts +88 -0
  27. package/dist/disconnect/originals.d.ts.map +1 -0
  28. package/dist/disconnect/originals.js +257 -0
  29. package/dist/disconnect/originals.js.map +1 -0
  30. package/dist/disconnect/plan.d.ts +175 -0
  31. package/dist/disconnect/plan.d.ts.map +1 -0
  32. package/dist/disconnect/plan.js +580 -0
  33. package/dist/disconnect/plan.js.map +1 -0
  34. package/dist/disconnect/recognise.d.ts +43 -0
  35. package/dist/disconnect/recognise.d.ts.map +1 -0
  36. package/dist/disconnect/recognise.js +108 -0
  37. package/dist/disconnect/recognise.js.map +1 -0
  38. package/dist/disconnect/tomlLines.d.ts +39 -0
  39. package/dist/disconnect/tomlLines.d.ts.map +1 -0
  40. package/dist/disconnect/tomlLines.js +105 -0
  41. package/dist/disconnect/tomlLines.js.map +1 -0
  42. package/dist/harness/aiderConfigMerger.d.ts +29 -8
  43. package/dist/harness/aiderConfigMerger.d.ts.map +1 -1
  44. package/dist/harness/aiderConfigMerger.js +63 -12
  45. package/dist/harness/aiderConfigMerger.js.map +1 -1
  46. package/dist/harness/antigravityCliHooks.d.ts +61 -0
  47. package/dist/harness/antigravityCliHooks.d.ts.map +1 -0
  48. package/dist/harness/antigravityCliHooks.js +207 -0
  49. package/dist/harness/antigravityCliHooks.js.map +1 -0
  50. package/dist/harness/antigravityHooks.d.ts +12 -2
  51. package/dist/harness/antigravityHooks.d.ts.map +1 -1
  52. package/dist/harness/antigravityHooks.js +38 -16
  53. package/dist/harness/antigravityHooks.js.map +1 -1
  54. package/dist/harness/antigravityProducts.d.ts +40 -0
  55. package/dist/harness/antigravityProducts.d.ts.map +1 -0
  56. package/dist/harness/antigravityProducts.js +109 -0
  57. package/dist/harness/antigravityProducts.js.map +1 -0
  58. package/dist/harness/claudeAgentsMd.d.ts +29 -0
  59. package/dist/harness/claudeAgentsMd.d.ts.map +1 -0
  60. package/dist/harness/claudeAgentsMd.js +80 -0
  61. package/dist/harness/claudeAgentsMd.js.map +1 -0
  62. package/dist/harness/claudeCodeHooks.d.ts +6 -6
  63. package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
  64. package/dist/harness/claudeCodeHooks.js +115 -28
  65. package/dist/harness/claudeCodeHooks.js.map +1 -1
  66. package/dist/harness/claudeProjectApproval.d.ts +53 -0
  67. package/dist/harness/claudeProjectApproval.d.ts.map +1 -0
  68. package/dist/harness/claudeProjectApproval.js +159 -0
  69. package/dist/harness/claudeProjectApproval.js.map +1 -0
  70. package/dist/harness/clineHooks.d.ts +0 -1
  71. package/dist/harness/clineHooks.d.ts.map +1 -1
  72. package/dist/harness/clineHooks.js +13 -4
  73. package/dist/harness/clineHooks.js.map +1 -1
  74. package/dist/harness/codexConfigMerger.d.ts.map +1 -1
  75. package/dist/harness/codexConfigMerger.js +4 -0
  76. package/dist/harness/codexConfigMerger.js.map +1 -1
  77. package/dist/harness/codexHooks.d.ts +2 -0
  78. package/dist/harness/codexHooks.d.ts.map +1 -1
  79. package/dist/harness/codexHooks.js +15 -4
  80. package/dist/harness/codexHooks.js.map +1 -1
  81. package/dist/harness/continueConfigMerger.d.ts.map +1 -1
  82. package/dist/harness/continueConfigMerger.js +4 -0
  83. package/dist/harness/continueConfigMerger.js.map +1 -1
  84. package/dist/harness/cursorHooks.d.ts +5 -2
  85. package/dist/harness/cursorHooks.d.ts.map +1 -1
  86. package/dist/harness/cursorHooks.js +12 -3
  87. package/dist/harness/cursorHooks.js.map +1 -1
  88. package/dist/harness/dshHooks.d.ts +5 -5
  89. package/dist/harness/dshHooks.d.ts.map +1 -1
  90. package/dist/harness/dshHooks.js +12 -5
  91. package/dist/harness/dshHooks.js.map +1 -1
  92. package/dist/harness/gateArtifacts.d.ts +35 -0
  93. package/dist/harness/gateArtifacts.d.ts.map +1 -0
  94. package/dist/harness/gateArtifacts.js +88 -0
  95. package/dist/harness/gateArtifacts.js.map +1 -0
  96. package/dist/harness/gateBody.d.ts +195 -69
  97. package/dist/harness/gateBody.d.ts.map +1 -1
  98. package/dist/harness/gateBody.js +847 -182
  99. package/dist/harness/gateBody.js.map +1 -1
  100. package/dist/harness/gateSightings.d.ts +47 -0
  101. package/dist/harness/gateSightings.d.ts.map +1 -0
  102. package/dist/harness/gateSightings.js +159 -0
  103. package/dist/harness/gateSightings.js.map +1 -0
  104. package/dist/harness/githubCopilotHooks.d.ts.map +1 -1
  105. package/dist/harness/githubCopilotHooks.js +11 -10
  106. package/dist/harness/githubCopilotHooks.js.map +1 -1
  107. package/dist/harness/gooseHardener.d.ts +0 -1
  108. package/dist/harness/gooseHardener.d.ts.map +1 -1
  109. package/dist/harness/gooseHardener.js +1 -1
  110. package/dist/harness/gooseHardener.js.map +1 -1
  111. package/dist/harness/gooseHooks.d.ts +29 -1
  112. package/dist/harness/gooseHooks.d.ts.map +1 -1
  113. package/dist/harness/gooseHooks.js +107 -69
  114. package/dist/harness/gooseHooks.js.map +1 -1
  115. package/dist/harness/grokHooks.d.ts +2 -2
  116. package/dist/harness/grokHooks.d.ts.map +1 -1
  117. package/dist/harness/grokHooks.js +20 -18
  118. package/dist/harness/grokHooks.js.map +1 -1
  119. package/dist/harness/hermesHooks.d.ts +18 -8
  120. package/dist/harness/hermesHooks.d.ts.map +1 -1
  121. package/dist/harness/hermesHooks.js +55 -19
  122. package/dist/harness/hermesHooks.js.map +1 -1
  123. package/dist/harness/holdRedaction.d.ts +4 -1
  124. package/dist/harness/holdRedaction.d.ts.map +1 -1
  125. package/dist/harness/holdRedaction.js +32 -8
  126. package/dist/harness/holdRedaction.js.map +1 -1
  127. package/dist/harness/jetbrainsXmlConfig.d.ts +20 -0
  128. package/dist/harness/jetbrainsXmlConfig.d.ts.map +1 -1
  129. package/dist/harness/jetbrainsXmlConfig.js +39 -18
  130. package/dist/harness/jetbrainsXmlConfig.js.map +1 -1
  131. package/dist/harness/mcpAutoWrite.d.ts +62 -25
  132. package/dist/harness/mcpAutoWrite.d.ts.map +1 -1
  133. package/dist/harness/mcpAutoWrite.js +406 -95
  134. package/dist/harness/mcpAutoWrite.js.map +1 -1
  135. package/dist/harness/museHooks.d.ts +3 -3
  136. package/dist/harness/museHooks.d.ts.map +1 -1
  137. package/dist/harness/museHooks.js +15 -7
  138. package/dist/harness/museHooks.js.map +1 -1
  139. package/dist/harness/n8nHooks.d.ts +0 -1
  140. package/dist/harness/n8nHooks.d.ts.map +1 -1
  141. package/dist/harness/n8nHooks.js +4 -1
  142. package/dist/harness/n8nHooks.js.map +1 -1
  143. package/dist/harness/openCodeHooks.d.ts +2 -2
  144. package/dist/harness/openCodeHooks.d.ts.map +1 -1
  145. package/dist/harness/openCodeHooks.js +9 -8
  146. package/dist/harness/openCodeHooks.js.map +1 -1
  147. package/dist/harness/openWebuiHooks.d.ts +0 -1
  148. package/dist/harness/openWebuiHooks.d.ts.map +1 -1
  149. package/dist/harness/openWebuiHooks.js +11 -3
  150. package/dist/harness/openWebuiHooks.js.map +1 -1
  151. package/dist/harness/openclawHooks.d.ts +75 -18
  152. package/dist/harness/openclawHooks.d.ts.map +1 -1
  153. package/dist/harness/openclawHooks.js +214 -160
  154. package/dist/harness/openclawHooks.js.map +1 -1
  155. package/dist/harness/openhandsHooks.d.ts +37 -11
  156. package/dist/harness/openhandsHooks.d.ts.map +1 -1
  157. package/dist/harness/openhandsHooks.js +148 -97
  158. package/dist/harness/openhandsHooks.js.map +1 -1
  159. package/dist/harness/piHooks.d.ts +52 -17
  160. package/dist/harness/piHooks.d.ts.map +1 -1
  161. package/dist/harness/piHooks.js +177 -163
  162. package/dist/harness/piHooks.js.map +1 -1
  163. package/dist/harness/protectedPaths.d.ts +107 -25
  164. package/dist/harness/protectedPaths.d.ts.map +1 -1
  165. package/dist/harness/protectedPaths.js +342 -48
  166. package/dist/harness/protectedPaths.js.map +1 -1
  167. package/dist/harness/rulesSection.d.ts +62 -0
  168. package/dist/harness/rulesSection.d.ts.map +1 -0
  169. package/dist/harness/rulesSection.js +145 -0
  170. package/dist/harness/rulesSection.js.map +1 -0
  171. package/dist/harness/windsurfHooks.d.ts +18 -3
  172. package/dist/harness/windsurfHooks.d.ts.map +1 -1
  173. package/dist/harness/windsurfHooks.js +41 -8
  174. package/dist/harness/windsurfHooks.js.map +1 -1
  175. package/dist/harness/windsurfJetBrainsProxy.d.ts +1 -1
  176. package/dist/harness/windsurfJetBrainsProxy.d.ts.map +1 -1
  177. package/dist/harness/windsurfJetBrainsProxy.js +5 -1
  178. package/dist/harness/windsurfJetBrainsProxy.js.map +1 -1
  179. package/dist/index.d.ts +21 -20
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +19 -19
  182. package/dist/index.js.map +1 -1
  183. package/dist/inventory.d.ts +53 -0
  184. package/dist/inventory.d.ts.map +1 -0
  185. package/dist/inventory.js +133 -0
  186. package/dist/inventory.js.map +1 -0
  187. package/dist/lib/complianceProbes.d.ts +2 -1
  188. package/dist/lib/complianceProbes.d.ts.map +1 -1
  189. package/dist/lib/complianceProbes.js +1 -1
  190. package/dist/lib/complianceProbes.js.map +1 -1
  191. package/dist/lib/decisionsDigest.d.ts +35 -17
  192. package/dist/lib/decisionsDigest.d.ts.map +1 -1
  193. package/dist/lib/decisionsDigest.js +106 -47
  194. package/dist/lib/decisionsDigest.js.map +1 -1
  195. package/dist/lib/egressPolicy.d.ts +2 -2
  196. package/dist/lib/egressPolicy.js +2 -2
  197. package/dist/lib/mcpRegistryPy.d.ts +11 -0
  198. package/dist/lib/mcpRegistryPy.d.ts.map +1 -0
  199. package/dist/lib/mcpRegistryPy.js +173 -0
  200. package/dist/lib/mcpRegistryPy.js.map +1 -0
  201. package/dist/lib/phrasesPy.d.ts +11 -0
  202. package/dist/lib/phrasesPy.d.ts.map +1 -0
  203. package/dist/lib/phrasesPy.js +351 -0
  204. package/dist/lib/phrasesPy.js.map +1 -0
  205. package/dist/lib/policySnapshot.d.ts +63 -9
  206. package/dist/lib/policySnapshot.d.ts.map +1 -1
  207. package/dist/lib/policySnapshot.js +269 -45
  208. package/dist/lib/policySnapshot.js.map +1 -1
  209. package/dist/lib/processPoller.d.ts.map +1 -1
  210. package/dist/lib/processPoller.js +9 -2
  211. package/dist/lib/processPoller.js.map +1 -1
  212. package/dist/lib/regexLinearity.d.ts +43 -0
  213. package/dist/lib/regexLinearity.d.ts.map +1 -0
  214. package/dist/lib/regexLinearity.js +275 -0
  215. package/dist/lib/regexLinearity.js.map +1 -0
  216. package/dist/lib/runtimeEnv.d.ts +1 -3
  217. package/dist/lib/runtimeEnv.d.ts.map +1 -1
  218. package/dist/lib/runtimeEnv.js +0 -2
  219. package/dist/lib/runtimeEnv.js.map +1 -1
  220. package/dist/lib/sequencePy.d.ts +10 -0
  221. package/dist/lib/sequencePy.d.ts.map +1 -0
  222. package/dist/lib/sequencePy.js +102 -0
  223. package/dist/lib/sequencePy.js.map +1 -0
  224. package/dist/sessionReporter.d.ts +18 -12
  225. package/dist/sessionReporter.d.ts.map +1 -1
  226. package/dist/sessionReporter.js +37 -24
  227. package/dist/sessionReporter.js.map +1 -1
  228. package/dist/skillWriter.d.ts +23 -5
  229. package/dist/skillWriter.d.ts.map +1 -1
  230. package/dist/skillWriter.js +159 -16
  231. package/dist/skillWriter.js.map +1 -1
  232. package/dist/syncCycle.d.ts +142 -0
  233. package/dist/syncCycle.d.ts.map +1 -0
  234. package/dist/syncCycle.js +327 -0
  235. package/dist/syncCycle.js.map +1 -0
  236. package/dist/trajectoryMonitor.d.ts +2 -4
  237. package/dist/trajectoryMonitor.d.ts.map +1 -1
  238. package/dist/trajectoryMonitor.js +2 -5
  239. package/dist/trajectoryMonitor.js.map +1 -1
  240. package/dist/watcher/driftWatcher.d.ts +0 -1
  241. package/dist/watcher/driftWatcher.d.ts.map +1 -1
  242. package/dist/watcher/driftWatcher.js +1 -2
  243. package/dist/watcher/driftWatcher.js.map +1 -1
  244. package/dist/watcher/settingsGuard.d.ts +36 -7
  245. package/dist/watcher/settingsGuard.d.ts.map +1 -1
  246. package/dist/watcher/settingsGuard.js +397 -60
  247. package/dist/watcher/settingsGuard.js.map +1 -1
  248. package/dist/watcher/vscodeHookSettings.d.ts +30 -0
  249. package/dist/watcher/vscodeHookSettings.d.ts.map +1 -0
  250. package/dist/watcher/vscodeHookSettings.js +170 -0
  251. package/dist/watcher/vscodeHookSettings.js.map +1 -0
  252. package/dist/wsClient.d.ts +0 -1
  253. package/dist/wsClient.d.ts.map +1 -1
  254. package/dist/wsClient.js +0 -1
  255. package/dist/wsClient.js.map +1 -1
  256. package/package.json +5 -5
  257. package/dist/harness/claudeDesktopHooks.d.ts +0 -30
  258. package/dist/harness/claudeDesktopHooks.d.ts.map +0 -1
  259. package/dist/harness/claudeDesktopHooks.js +0 -254
  260. package/dist/harness/claudeDesktopHooks.js.map +0 -1
  261. package/dist/harness/continueHooks.d.ts +0 -63
  262. package/dist/harness/continueHooks.d.ts.map +0 -1
  263. package/dist/harness/continueHooks.js +0 -247
  264. package/dist/harness/continueHooks.js.map +0 -1
  265. package/dist/harness/gateKind.d.ts +0 -164
  266. package/dist/harness/gateKind.d.ts.map +0 -1
  267. package/dist/harness/gateKind.js +0 -144
  268. package/dist/harness/gateKind.js.map +0 -1
  269. package/dist/harness/rooCodeHooks.d.ts +0 -31
  270. package/dist/harness/rooCodeHooks.d.ts.map +0 -1
  271. package/dist/harness/rooCodeHooks.js +0 -286
  272. package/dist/harness/rooCodeHooks.js.map +0 -1
  273. package/dist/hashReporter.d.ts +0 -33
  274. package/dist/hashReporter.d.ts.map +0 -1
  275. package/dist/hashReporter.js +0 -69
  276. package/dist/hashReporter.js.map +0 -1
  277. package/dist/integrityStore.d.ts +0 -35
  278. package/dist/integrityStore.d.ts.map +0 -1
  279. package/dist/integrityStore.js +0 -71
  280. package/dist/integrityStore.js.map +0 -1
  281. package/dist/lib/gitWorktrees.d.ts +0 -140
  282. package/dist/lib/gitWorktrees.d.ts.map +0 -1
  283. package/dist/lib/gitWorktrees.js +0 -191
  284. package/dist/lib/gitWorktrees.js.map +0 -1
  285. package/dist/syncLoop.d.ts +0 -172
  286. package/dist/syncLoop.d.ts.map +0 -1
  287. package/dist/syncLoop.js +0 -878
  288. package/dist/syncLoop.js.map +0 -1
@@ -82,8 +82,40 @@ export declare const UNIVERSAL_PROTECTED_PATHS: readonly string[];
82
82
  */
83
83
  /** `action` is the space-padded action-token string the gate classifies a
84
84
  * shell command to (`" action:deploy "`, from `ACTION_NEEDLES`) — the subject
85
- * a `review_before: action:deploy` hold rule matches. */
86
- export type GuardSubject = 'tool' | 'command' | 'target' | 'content' | 'action' | 'any';
85
+ * a `review_before: action:deploy` hold rule matches.
86
+ *
87
+ * `phrase` is not a regex at all: the source is phrases joined by `|`, each
88
+ * matched as words in the raw command by the phrase matcher
89
+ * (`@intutic/shared-types` phrases.ts), with a word boundary before the first
90
+ * word and after the last. It is for rules whose words may be split by a
91
+ * comment, an escape or a line continuation — a gap a regex can only express
92
+ * by backtracking, which runs for seconds on crafted text in the JS and
93
+ * Python gates. A gate that predates the subject reads the source as a regex
94
+ * over the command and target, which still matches the plain spellings. */
95
+ export type GuardSubject = 'tool' | 'command' | 'target' | 'content' | 'action' | 'phrase' | 'any';
96
+ /**
97
+ * The length every adversarial case is built to: the largest command a gate
98
+ * evaluates before refusing it as too large (`COMMAND_SIZE_LIMIT`). Content
99
+ * cases are built to it too; content may be four times longer, and every
100
+ * content rule is linear, so the bound scales with it.
101
+ */
102
+ export declare const ADVERSARIAL_LENGTH: number;
103
+ /**
104
+ * A text of at most {@link ADVERSARIAL_LENGTH} characters: `prefix`, then
105
+ * `unit` repeated as many whole times as fit, then `suffix`. It is the call's `command` for a
106
+ * command, phrase or `any` rule, its `file_path` for a target rule, and its
107
+ * `content` for a content rule or one with an argPattern (beside a
108
+ * `file_path` the rule's target matches).
109
+ */
110
+ export interface AdversarialCase {
111
+ /** What the text is shaped to make a backtracking engine do. */
112
+ name: string;
113
+ prefix?: string;
114
+ unit: string;
115
+ suffix?: string;
116
+ /** Whether the rule matches the text. */
117
+ held: boolean;
118
+ }
87
119
  export interface GuardPattern {
88
120
  /** Stable id. Appears in the block message and the audit line, so it is the
89
121
  * thing a support conversation is conducted in. Never renumber one. */
@@ -99,6 +131,23 @@ export interface GuardPattern {
99
131
  subject?: GuardSubject;
100
132
  /** Matched case-insensitively (`grep -iE` / the JS `i` flag). */
101
133
  ignoreCase?: boolean;
134
+ /**
135
+ * Evaluate {@link source} as a sequence, in linear time, in the gates whose
136
+ * regex engine backtracks (JavaScript and Python).
137
+ *
138
+ * The source stays an ordinary regex — `grep -E`, which matches with an
139
+ * automaton, and a gate older than gate body v13 run it as written — but it
140
+ * must have the shape `A .* B | C .* D …`: alternatives at the top level,
141
+ * each a chain of steps joined by `.*`. A backtracking engine ran
142
+ * ` git .*(…)` from every ` git ` in the text and scanned to the end from
143
+ * each: 200 KB of `git -- ` took 9.5 s in the JS gates. Read as a sequence,
144
+ * each step is searched once, from where the previous one ended, so the text
145
+ * is read once per step. That is the regex's own meaning whenever an
146
+ * earlier match of a step never ends later than a later one, which holds for
147
+ * every step here (a word between spaces, or a fixed string); see
148
+ * {@link sequenceAlternatives}.
149
+ */
150
+ sequence?: boolean;
102
151
  /**
103
152
  * What the rule does when it matches.
104
153
  *
@@ -129,6 +178,14 @@ export interface GuardPattern {
129
178
  * cheapest way to write a guard that never fires wrongly is to never think
130
179
  * about the case where it would. */
131
180
  notMatches: readonly string[];
181
+ /**
182
+ * Texts built to stall a backtracking engine, and whether the rule matches
183
+ * each. Every table rule carries at least one; `gate-rule-vectors.json`
184
+ * (packages/shared-types/fixtures) takes them to every reader, which must
185
+ * agree with `held` and decide each in time linear in its length. See
186
+ * {@link AdversarialCase} for where the text goes.
187
+ */
188
+ adversarial?: readonly AdversarialCase[];
132
189
  /**
133
190
  * Argument-level condition from a ` WHERE ` SOP rule, as JS `RegExp` source.
134
191
  *
@@ -177,23 +234,10 @@ export declare const NORMALISE_CONTRACT: {
177
234
  * property this contract claims, and the next edit would not have been so lucky.
178
235
  *
179
236
  * Python's `\s` on a `str` covers Unicode whitespace (U+00A0, U+3000), matching
180
- * JS. The shell fallback cannot, which is why SHELL_EXTRACT pre-passes.
237
+ * JS, as does `SHELL_EXTRACT`'s `split()` for the bash gates.
181
238
  */
182
239
  /** Requires `re` in scope — the emitted filter imports it. */
183
240
  readonly pySource: string;
184
- /**
185
- * Shell: pure parameter expansion — no subshell, no `tr`, no `python3`.
186
- *
187
- * **ASCII only, and deliberately second in line.** Bash cannot express a
188
- * Unicode whitespace class, so this collapses only the C0 set; U+00A0 would
189
- * survive it and a pattern written with a literal space would then miss. The
190
- * bash gates are not exposed to that because `SHELL_EXTRACT` runs every field
191
- * through Python's `" ".join(str(v).split())` *before* this ever sees it —
192
- * which is Unicode-aware. This is the belt to that pair of braces, and saying
193
- * so here is the point: an earlier version of this comment claimed the three
194
- * normalisers were provably identical, and they were not.
195
- */
196
- readonly shell: string;
197
241
  };
198
242
  /**
199
243
  * Rejects any pattern that would not mean the same thing to `grep -E` and to
@@ -209,6 +253,28 @@ export declare const NORMALISE_CONTRACT: {
209
253
  * running us in an Alpine image would get a gate that silently matches nothing.
210
254
  */
211
255
  export declare function assertPortableEre(source: string, id: string): void;
256
+ /**
257
+ * Refuses a rule a backtracking engine could run in super-linear time — the
258
+ * JavaScript and Python gates both backtrack, and a slow gate under a harness
259
+ * that allows on timeout is no gate. A `sequence` rule is checked step by
260
+ * step, the way those gates run it; a `phrase` rule is not a regex. Anything
261
+ * reported must be on BACKTRACKING_ALLOWLIST (regexLinearity.ts) by id.
262
+ */
263
+ export declare function assertLinearRule(p: GuardPattern): void;
264
+ /**
265
+ * A rule's flags column in a `.rules` line and the gates' tables: `i` for
266
+ * case-insensitive, `s` for a sequence rule, `-` for neither. A gate older
267
+ * than gate body v13 compares the column with `i`, so it runs a sequence rule
268
+ * as the plain regex it also is.
269
+ */
270
+ export declare function ruleFlags(p: Pick<GuardPattern, 'ignoreCase' | 'sequence'>): string;
271
+ /**
272
+ * Whether a rule fires on `text` the way every gate evaluates it: a `phrase`
273
+ * rule through the phrase matcher on the raw text, any other as a regex over
274
+ * the normalised text. For fixtures and tests; the gates carry their own copy
275
+ * of each half.
276
+ */
277
+ export declare function guardMatches(p: GuardPattern, text: string): boolean;
212
278
  /**
213
279
  * Commands that disarm governance itself.
214
280
  *
@@ -217,6 +283,22 @@ export declare function assertPortableEre(source: string, id: string): void;
217
283
  * all, and every list guarded only its own harness's env kill-switch.
218
284
  */
219
285
  export declare const GOVERNANCE_BYPASS_PATTERNS: readonly GuardPattern[];
286
+ /**
287
+ * The VS Code settings that can switch off the GitHub Copilot gate.
288
+ *
289
+ * VS Code loads hook files from `.github/hooks` (workspace) and
290
+ * `~/.copilot/hooks` (user) by default, so the Copilot gate needs no setting
291
+ * of its own, and no VS Code policy locks the setting that can drop one of
292
+ * those locations. Two keys are what an agent would reach for: `chat.useHooks`
293
+ * set to false turns every hook off, and `chat.hookFilesLocations` mapping a
294
+ * location to false drops it. Both are read from user, workspace, profile and
295
+ * `.code-workspace` settings, and no other file has reason to set them, so an
296
+ * edit that sets either key is refused whatever file it writes, and a shell
297
+ * command that names either key is refused too. The settings guard restores
298
+ * the keys if a change reaches the file another way (`settingsGuard.ts`), and
299
+ * the `ChatHooks` policy is the administrator's hard lock.
300
+ */
301
+ export declare const HOOK_SETTING_PATTERNS: readonly GuardPattern[];
220
302
  /**
221
303
  * Credential VALUES in the content an agent is about to write.
222
304
  *
@@ -263,7 +345,7 @@ export declare const SECRET_CONTENT_PATTERNS: readonly GuardPattern[];
263
345
  * Writes and edits targeting the agent-skill surface — `.agents/skills/**`
264
346
  * and `.claude/skills/**`.
265
347
  *
266
- * TD-358 (updated 2026-08-18): these two entries stay `warn` and stay
348
+ * Updated 2026-08-18: these two entries stay `warn` and stay
267
349
  * compiled into {@link staticFloorPatterns} — that part of the original
268
350
  * decision is unchanged. What changed is what that tier assignment now
269
351
  * *means*: it is the DEGRADED-MODE baseline, not the intended steady state.
@@ -305,8 +387,8 @@ export declare const SECRET_CONTENT_PATTERNS: readonly GuardPattern[];
305
387
  * rule on purpose, since that rule blocks and this one only advises.
306
388
  *
307
389
  * Blocking on skill CONTENT (not path) is a separate table,
308
- * {@link SKILL_CONTENT_PATTERNS}, licensed by the benign-corpus measurement
309
- * TD-358 asked for and shipped only through the policy snapshot.
390
+ * {@link SKILL_CONTENT_PATTERNS}, licensed by a benign-corpus false-positive
391
+ * measurement and shipped only through the policy snapshot.
310
392
  */
311
393
  export declare const SKILL_SURFACE_PATTERNS: readonly GuardPattern[];
312
394
  /**
@@ -331,7 +413,7 @@ export declare const SKILL_SURFACE_PATTERNS: readonly GuardPattern[];
331
413
  */
332
414
  export declare function caseFoldedArgSource(source: string): string;
333
415
  /**
334
- * Skill-CONTENT block tier (TD-358): a write into a skill directory whose
416
+ * Skill-CONTENT block tier: a write into a skill directory whose
335
417
  * written text matches one of the `skillScan.ts` patterns measured at zero
336
418
  * false positives on the benign-skill corpus (`SKILL_CONTENT_BLOCK_PATTERN_IDS`;
337
419
  * `packages/shared-types/src/__tests__/corpus/skills/`, 350 real skills).
@@ -344,7 +426,7 @@ export declare function caseFoldedArgSource(source: string): string;
344
426
  * pattern inside the value of a {@link WRITTEN_CONTENT_KEYS} key of the
345
427
  * serialized tool input.
346
428
  *
347
- * **Snapshot-only, never in `staticFloorPatterns()`**, as TD-358 required: a
429
+ * **Snapshot-only, never in `staticFloorPatterns()`**, by design: a
348
430
  * content judgement ships where one sync cycle retracts it
349
431
  * (`SKILL_CONTENT_TIER_SEVERITY` in `lib/policySnapshot.ts`). The table's own
350
432
  * `warn` is a placeholder the snapshot builder always overrides.
@@ -373,9 +455,9 @@ export declare const SKILL_CONTENT_PATTERNS: readonly GuardPattern[];
373
455
  /**
374
456
  * Commands that destroy the machine or its data irrecoverably.
375
457
  *
376
- * TD-309: none of these were blocked by any harness. They are shipped through
377
- * the policy snapshot rather than compiled into the gate, and at `warn` before
378
- * `block` — see the note on `severity` below.
458
+ * None of these were blocked by any harness before this table. They are
459
+ * shipped through the policy snapshot rather than compiled into the gate, and
460
+ * at `warn` before `block` — see the note on `severity` below.
379
461
  *
380
462
  * ## What is deliberately allowed
381
463
  *
@@ -401,7 +483,7 @@ export declare function protectedPathShellPatterns(): readonly GuardPattern[];
401
483
  * without a release. `SKILL_SURFACE_PATTERNS` IS here, deliberately, despite
402
484
  * also being new: unlike the destructive tier it is a deterministic path
403
485
  * match with no content judgement to get wrong, so there is no measurement
404
- * risk to hold it back from — see its own doc comment. As of TD-358's
486
+ * risk to hold it back from — see its own doc comment. As of the skill-surface
405
487
  * block-tier promotion these two entries are the DEGRADED-MODE baseline
406
488
  * only: the steady state is `block`, delivered through the policy snapshot
407
489
  * (`SKILL_SURFACE_TIER_SEVERITY` in `lib/policySnapshot.ts`) and additive on
@@ -1 +1 @@
1
- {"version":3,"file":"protectedPaths.d.ts","sourceRoot":"","sources":["../../src/harness/protectedPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAIH,iEAAiE;AACjE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAuEtD,CAAA;AAMD;;;;;;;GAOG;AACH;;;;;;;;;GASG;AACH;;0DAE0D;AAC1D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEvF,MAAM,WAAW,YAAY;IAC3B;4EACwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAA;IACd;;;;;6BAKyB;IACzB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC9C;wDACoD;IACpD,MAAM,EAAE,MAAM,CAAA;IACd;;2BAEuB;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B;;;yCAGqC;IACrC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAoCD,eAAO,MAAM,kBAAkB;IAC7B;;;;;;OAMG;iBACqD,CAAC,CAAC,EAAE,OAAO,KAAK,MAAM;IAE9E,oEAAoE;;IAGpE;;;;;;;;;;;;;OAaG;IACH,8DAA8D;;IAM9D;;;;;;;;;;;OAWG;;CASK,CAAA;AAEV;;;;;;;;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