@intutic/sync-daemon 2.4.0 → 2.5.1

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 (150) hide show
  1. package/README.md +6 -14
  2. package/dist/agentReporter.d.ts +11 -1
  3. package/dist/agentReporter.d.ts.map +1 -1
  4. package/dist/agentReporter.js +9 -2
  5. package/dist/agentReporter.js.map +1 -1
  6. package/dist/configWriter.d.ts +2 -1
  7. package/dist/configWriter.d.ts.map +1 -1
  8. package/dist/configWriter.js +4 -4
  9. package/dist/configWriter.js.map +1 -1
  10. package/dist/disconnect/originals.d.ts.map +1 -1
  11. package/dist/disconnect/originals.js +5 -12
  12. package/dist/disconnect/originals.js.map +1 -1
  13. package/dist/disconnect/plan.d.ts.map +1 -1
  14. package/dist/disconnect/plan.js +3 -14
  15. package/dist/disconnect/plan.js.map +1 -1
  16. package/dist/harness/aiderConfigMerger.d.ts.map +1 -1
  17. package/dist/harness/aiderConfigMerger.js +4 -9
  18. package/dist/harness/aiderConfigMerger.js.map +1 -1
  19. package/dist/harness/antigravityCliHooks.d.ts.map +1 -1
  20. package/dist/harness/antigravityCliHooks.js +3 -7
  21. package/dist/harness/antigravityCliHooks.js.map +1 -1
  22. package/dist/harness/antigravityHooks.d.ts.map +1 -1
  23. package/dist/harness/antigravityHooks.js +3 -7
  24. package/dist/harness/antigravityHooks.js.map +1 -1
  25. package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
  26. package/dist/harness/claudeCodeHooks.js +15 -4
  27. package/dist/harness/claudeCodeHooks.js.map +1 -1
  28. package/dist/harness/clineHooks.d.ts.map +1 -1
  29. package/dist/harness/clineHooks.js +4 -5
  30. package/dist/harness/clineHooks.js.map +1 -1
  31. package/dist/harness/codexConfigMerger.d.ts.map +1 -1
  32. package/dist/harness/codexConfigMerger.js +2 -3
  33. package/dist/harness/codexConfigMerger.js.map +1 -1
  34. package/dist/harness/codexHooks.d.ts.map +1 -1
  35. package/dist/harness/codexHooks.js +3 -7
  36. package/dist/harness/codexHooks.js.map +1 -1
  37. package/dist/harness/continueConfigMerger.d.ts.map +1 -1
  38. package/dist/harness/continueConfigMerger.js +2 -3
  39. package/dist/harness/continueConfigMerger.js.map +1 -1
  40. package/dist/harness/cursorHooks.d.ts.map +1 -1
  41. package/dist/harness/cursorHooks.js +12 -8
  42. package/dist/harness/cursorHooks.js.map +1 -1
  43. package/dist/harness/dshHooks.d.ts.map +1 -1
  44. package/dist/harness/dshHooks.js +7 -18
  45. package/dist/harness/dshHooks.js.map +1 -1
  46. package/dist/harness/gateBody.d.ts +39 -2
  47. package/dist/harness/gateBody.d.ts.map +1 -1
  48. package/dist/harness/gateBody.js +465 -70
  49. package/dist/harness/gateBody.js.map +1 -1
  50. package/dist/harness/gateSightings.d.ts.map +1 -1
  51. package/dist/harness/gateSightings.js +2 -3
  52. package/dist/harness/gateSightings.js.map +1 -1
  53. package/dist/harness/githubCopilotHooks.d.ts.map +1 -1
  54. package/dist/harness/githubCopilotHooks.js +2 -4
  55. package/dist/harness/githubCopilotHooks.js.map +1 -1
  56. package/dist/harness/gooseHooks.d.ts +13 -5
  57. package/dist/harness/gooseHooks.d.ts.map +1 -1
  58. package/dist/harness/gooseHooks.js +39 -25
  59. package/dist/harness/gooseHooks.js.map +1 -1
  60. package/dist/harness/grokHooks.d.ts.map +1 -1
  61. package/dist/harness/grokHooks.js +4 -10
  62. package/dist/harness/grokHooks.js.map +1 -1
  63. package/dist/harness/hermesHooks.d.ts.map +1 -1
  64. package/dist/harness/hermesHooks.js +5 -13
  65. package/dist/harness/hermesHooks.js.map +1 -1
  66. package/dist/harness/mcpAutoWrite.d.ts.map +1 -1
  67. package/dist/harness/mcpAutoWrite.js +9 -10
  68. package/dist/harness/mcpAutoWrite.js.map +1 -1
  69. package/dist/harness/museHooks.d.ts.map +1 -1
  70. package/dist/harness/museHooks.js +4 -10
  71. package/dist/harness/museHooks.js.map +1 -1
  72. package/dist/harness/n8nHooks.d.ts +2 -1
  73. package/dist/harness/n8nHooks.d.ts.map +1 -1
  74. package/dist/harness/n8nHooks.js +52 -22
  75. package/dist/harness/n8nHooks.js.map +1 -1
  76. package/dist/harness/openWebuiHooks.d.ts.map +1 -1
  77. package/dist/harness/openWebuiHooks.js +7 -7
  78. package/dist/harness/openWebuiHooks.js.map +1 -1
  79. package/dist/harness/openclawHooks.d.ts.map +1 -1
  80. package/dist/harness/openclawHooks.js +5 -4
  81. package/dist/harness/openclawHooks.js.map +1 -1
  82. package/dist/harness/openhandsHooks.d.ts.map +1 -1
  83. package/dist/harness/openhandsHooks.js +4 -10
  84. package/dist/harness/openhandsHooks.js.map +1 -1
  85. package/dist/harness/piHooks.d.ts +3 -1
  86. package/dist/harness/piHooks.d.ts.map +1 -1
  87. package/dist/harness/piHooks.js +5 -4
  88. package/dist/harness/piHooks.js.map +1 -1
  89. package/dist/harness/protectedPaths.d.ts +3 -1
  90. package/dist/harness/protectedPaths.d.ts.map +1 -1
  91. package/dist/harness/protectedPaths.js +56 -2
  92. package/dist/harness/protectedPaths.js.map +1 -1
  93. package/dist/harness/rulesSection.d.ts.map +1 -1
  94. package/dist/harness/rulesSection.js +3 -7
  95. package/dist/harness/rulesSection.js.map +1 -1
  96. package/dist/harness/windsurfHooks.d.ts.map +1 -1
  97. package/dist/harness/windsurfHooks.js +3 -7
  98. package/dist/harness/windsurfHooks.js.map +1 -1
  99. package/dist/harness/windsurfJetBrainsProxy.d.ts.map +1 -1
  100. package/dist/harness/windsurfJetBrainsProxy.js +1 -5
  101. package/dist/harness/windsurfJetBrainsProxy.js.map +1 -1
  102. package/dist/inventory.js +1 -1
  103. package/dist/inventory.js.map +1 -1
  104. package/dist/lib/approvedBypasses.d.ts.map +1 -1
  105. package/dist/lib/approvedBypasses.js +2 -4
  106. package/dist/lib/approvedBypasses.js.map +1 -1
  107. package/dist/lib/atomicWrite.d.ts +45 -0
  108. package/dist/lib/atomicWrite.d.ts.map +1 -0
  109. package/dist/lib/atomicWrite.js +104 -0
  110. package/dist/lib/atomicWrite.js.map +1 -0
  111. package/dist/lib/chaosPy.d.ts +11 -0
  112. package/dist/lib/chaosPy.d.ts.map +1 -0
  113. package/dist/lib/chaosPy.js +320 -0
  114. package/dist/lib/chaosPy.js.map +1 -0
  115. package/dist/lib/complianceProbes.d.ts +28 -7
  116. package/dist/lib/complianceProbes.d.ts.map +1 -1
  117. package/dist/lib/complianceProbes.js +47 -14
  118. package/dist/lib/complianceProbes.js.map +1 -1
  119. package/dist/lib/decisionsDigest.d.ts.map +1 -1
  120. package/dist/lib/decisionsDigest.js +2 -5
  121. package/dist/lib/decisionsDigest.js.map +1 -1
  122. package/dist/lib/egressPolicy.d.ts.map +1 -1
  123. package/dist/lib/egressPolicy.js +2 -4
  124. package/dist/lib/egressPolicy.js.map +1 -1
  125. package/dist/lib/policySnapshot.d.ts +2 -2
  126. package/dist/lib/policySnapshot.d.ts.map +1 -1
  127. package/dist/lib/policySnapshot.js +43 -20
  128. package/dist/lib/policySnapshot.js.map +1 -1
  129. package/dist/lib/regexLinearity.d.ts.map +1 -1
  130. package/dist/lib/regexLinearity.js +2 -0
  131. package/dist/lib/regexLinearity.js.map +1 -1
  132. package/dist/lib/runtimeEnv.d.ts.map +1 -1
  133. package/dist/lib/runtimeEnv.js +3 -4
  134. package/dist/lib/runtimeEnv.js.map +1 -1
  135. package/dist/skillWriter.d.ts +2 -2
  136. package/dist/skillWriter.d.ts.map +1 -1
  137. package/dist/skillWriter.js +10 -6
  138. package/dist/skillWriter.js.map +1 -1
  139. package/dist/trajectoryMonitor.d.ts +22 -6
  140. package/dist/trajectoryMonitor.d.ts.map +1 -1
  141. package/dist/trajectoryMonitor.js +40 -9
  142. package/dist/trajectoryMonitor.js.map +1 -1
  143. package/dist/watcher/settingsGuard.d.ts.map +1 -1
  144. package/dist/watcher/settingsGuard.js +23 -2
  145. package/dist/watcher/settingsGuard.js.map +1 -1
  146. package/dist/wsClient.d.ts +0 -1
  147. package/dist/wsClient.d.ts.map +1 -1
  148. package/dist/wsClient.js +0 -6
  149. package/dist/wsClient.js.map +1 -1
  150. package/package.json +22 -15
@@ -1 +1 @@
1
- {"version":3,"file":"regexLinearity.js","sourceRoot":"","sources":["../../src/lib/regexLinearity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAkBH,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAU,EAAW,EAAE;IAClD,MAAM,CAAC,GAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7C,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;QAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IAC5C,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AACD,MAAM,KAAK,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,CAAA;AAC9E,MAAM,MAAM,GAAG,CAAC,CAAU,EAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACxD,MAAM,KAAK,GAAY,CAAC,GAAG,EAAE;IAC3B,MAAM,CAAC,GAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7C,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;QAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IACpD,OAAO,CAAC,CAAA;AACV,CAAC,CAAC,EAAE,CAAA;AACJ,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE,EAAE,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d,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC5E"}
1
+ {"version":3,"file":"runtimeEnv.d.ts","sourceRoot":"","sources":["../../src/lib/runtimeEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAUH,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,QAA4D,CAAA;AAEjG,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC5E"}
@@ -22,6 +22,7 @@ import * as fs from 'node:fs/promises';
22
22
  import * as path from 'node:path';
23
23
  import * as os from 'node:os';
24
24
  import { createLogger } from '@intutic/logger';
25
+ import { writeFileAtomic } from './atomicWrite.js';
25
26
  const log = createLogger('sync-runtime-env');
26
27
  /** Default path to the runtime env file sourced by all generated hook scripts. */
27
28
  export const DEFAULT_RUNTIME_ENV_PATH = path.join(os.homedir(), '.intutic', 'env', 'runtime.env');
@@ -62,10 +63,8 @@ export async function writeRuntimeEnv(opts) {
62
63
  `# LLM_BASE_URL=http://127.0.0.1:8080`,
63
64
  ``,
64
65
  ].join('\n');
65
- const tmpPath = envPath + '.tmp';
66
- await fs.writeFile(tmpPath, content, { encoding: 'utf-8' });
67
- await fs.chmod(tmpPath, 0o600);
68
- await fs.rename(tmpPath, envPath);
66
+ // 0600 from the moment the temp file exists: it holds the API key.
67
+ await writeFileAtomic(envPath, content, { mode: 0o600 });
69
68
  log.debug({ action: 'runtime_env_written', path: envPath }, 'Runtime env file refreshed');
70
69
  }
71
70
  //# sourceMappingURL=runtimeEnv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeEnv.js","sourceRoot":"","sources":["../../src/lib/runtimeEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,GAAG,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAA;AAE5C,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;AA0BjG;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAuB;IAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAwB,CAAA;IACxD,MAAM,MAAM,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IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAExD,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,4BAA4B,CAAC,CAAA;AAC3F,CAAC"}
@@ -24,11 +24,11 @@
24
24
  /** Workspace-relative path the rule-author skill is written to. */
25
25
  export declare const RULE_AUTHOR_SKILL_PATH: string;
26
26
  /** Embedded copy of .agents/skills/intutic-rule-author/SKILL.md (canonical). */
27
- export declare const RULE_AUTHOR_SKILL = "---\nname: intutic-rule-author\ndescription: Convert natural-language business rules into compiled WASM governance policies enforced by the local Intutic proxy \u2014 author, compile, dry-run, and install rules without a control plane.\n---\n\n# \uD83D\uDCDC Rule Author \u2014 Business Rules as Enforced WASM Policies\n\nUse this skill whenever the user states a rule that AI agent traffic must obey \u2014 \"block any agent call that touches the prod database\", \"kill requests once the session budget drops below $1\", \"never allow shell tool calls containing rm -rf\". You convert the rule into an AssemblyScript policy, compile it to WebAssembly, dry-run it against mock contexts, and install it into the local Intutic proxy. The proxy hot-loads it within ~5 seconds and enforces it on every intercepted LLM request.\n\n**The other way you get here is `/fix`.** That proxy command scores the workspace's governance posture and, when it finds no custom policy, recommends: *\"Add a WASM rule under `~/.intutic/wasm` to codify a custom guardrail.\"* When that recommendation is the prompt, the rule to author is the gap `/fix` found \u2014 ask the user which specific behaviour they want blocked rather than writing a generic rule, then run `/fix` again after installing to confirm the posture score moved. If it did not, the rule is not loading: check `intutic policy list-local` and the sandbox constraints in \u00A72, since a rule that violates them is silently disabled.\n\n## 1. The contract your rule sees\n\nThe proxy calls `evaluate(offset, len)` with a JSON-serialized `RequestContext`:\n\n```jsonc\n{\n \"session_id\": \"sess_x\", \"workspace_id\": \"ws_x\", \"virtual_key_prefix\": \"vk_x\",\n \"model\": \"claude-3-5-sonnet\",\n \"tools\": [{ \"name\": \"bash\", \"description\": \"run shell commands\" }],\n \"tool_calls\": [{ \"id\": \"t1\", \"name\": \"bash\", \"arguments\": {} }],\n \"estimated_input_tokens\": 1200,\n \"budget_remaining_usd\": 4.25,\n \"risk_tier\": \"Low\",\n \"dlp_findings\": [{ \"category\": \"secret\", \"pattern_name\": \"aws_access_key\", \"action\": \"redact\", \"offset\": 0, \"length\": 20 }],\n \"tool_sequence\": [\"read_file\", \"bash\"]\n}\n```\n\n`risk_tier` is one of `Low | Medium | High | Critical`. Return an `i32` verdict: `0` = ALLOW, `1` = BLOCK, `3` = REASK (refuse this attempt, tell the agent why, let it retry). `2` is deprecated \u2014 the guest never receives the request body, so redaction was never expressible; the proxy maps it to a block. Prefer `3` over `1` for any finding that is a pattern match, because pattern matches produce false positives.\n\n## 2. Author\n\nStart from the `@intutic/wasm-sdk` template (`packages/wasm-sdk/` in the open-core repo). Add one function per business rule and call it from `runRules()` in `assembly/index.ts`.\n\nSandbox constraints \u2014 a rule that breaks one reaches no verdict, and every call it could not judge is refused with `GOVERNANCE_UNAVAILABLE`, whatever the proxy's fail setting:\n\n- 1,000,000 fuel (instructions), the limit to write against; a 1 s wall-clock backstop; 16 MB memory.\n- Keep logic simple: no unbounded loops over `arguments`, no recursion, no I/O (none exists in the sandbox).\n- Host imports are limited to `env.log_info`, `env.trace`, `env.abort` and `env.read_referenced_file` (reads the bytes of a file the host already resolved before the sandbox existed \u2014 not a filesystem import, and it cannot be used to browse). A rule importing anything else cannot link, so it is refused at `intutic policy install` and refused again when the proxy loads it.\n- **`Math.random()` is unavailable.** AssemblyScript compiles it to an `env.seed` import the proxy does not provide. This list previously named `env.seed`, and a rule using randomness installed clean and then failed to link on every request \u2014 enforcing nothing, silently. Beyond the missing import, a verdict that samples is not a verdict: the same request would get different answers, and the audit trail would not explain either.\n\n## 3. Compile\n\n```bash\nintutic policy compile --src assembly/index.ts --out build/rule.wasm\n```\n\nRequires AssemblyScript in the project: `pnpm add -D assemblyscript assemblyscript-json`.\n\n## 4. Dry-run \u2014 required before install\n\nAuthor BOTH mock contexts and verify both outcomes before installing:\n\n```bash\nintutic policy test --wasm build/rule.wasm --mock should-block.json\nintutic policy test --wasm build/rule.wasm --mock should-allow.json\n```\n\nThe first must report BLOCK, the second ALLOW. A rule that blocks everything is as broken as one that blocks nothing.\n\n## 5. Install\n\n```bash\nintutic policy install --wasm build/rule.wasm --name block-prod-db --priority 50\nintutic policy list-local\n```\n\nRules install to `~/.intutic/wasm/` as `NN_name.wasm` (lower `NN` runs first; default 100). The proxy picks up changes within ~5 s on the next request \u2014 no restart needed.\n\n## 6. Guardrails\n\n- **Never embed secrets** (API keys, tokens, passwords) in rule sources or mock contexts \u2014 `intutic skill audit` flags them.\n- **Local rules cannot weaken central rules.** Verdicts merge most-restrictive-wins: a KILL from any rule \u2014 local or centrally synced \u2014 ends the request. \"Allow-override\" rules are no-ops by design; do not author them.\n- Keep rule sources (`assembly/*.ts`, mock JSON files) in version control alongside the workspace.\n";
27
+ export declare const RULE_AUTHOR_SKILL = "---\nname: intutic-rule-author\ndescription: Convert natural-language business rules into compiled WASM governance policies enforced by the local Intutic proxy \u2014 author, compile, dry-run, and install rules without a control plane.\n---\n\n# \uD83D\uDCDC Rule Author \u2014 Business Rules as Enforced WASM Policies\n\nUse this skill whenever the user states a rule that AI agent traffic must obey \u2014 \"block any agent call that touches the prod database\", \"kill requests once the session budget drops below $1\", \"never allow shell tool calls containing rm -rf\". You convert the rule into an AssemblyScript policy, compile it to WebAssembly, dry-run it against mock contexts, and install it into the local Intutic proxy. The proxy hot-loads it within ~5 seconds and enforces it on every intercepted LLM request.\n\n**The other way you get here is `/fix`.** That proxy command scores the workspace's governance posture and, when it finds no custom policy, recommends: *\"Add a WASM rule under `~/.intutic/wasm` to codify a custom guardrail.\"* When that recommendation is the prompt, the rule to author is the gap `/fix` found \u2014 ask the user which specific behaviour they want blocked rather than writing a generic rule, then run `/fix` again after installing to confirm the posture score moved. If it did not, the rule is not loading: check `intutic policy list-local` and the sandbox constraints in \u00A72. A rule that breaks them is not skipped silently: it reaches no verdict, and every request it could not judge is refused with `GOVERNANCE_UNAVAILABLE`.\n\n## 1. The contract your rule sees\n\nThe proxy calls `evaluate(offset, len)` with a JSON-serialized `RequestContext`:\n\n```jsonc\n{\n \"session_id\": \"sess_x\", \"workspace_id\": \"ws_x\", \"virtual_key_prefix\": \"vk_x\",\n \"model\": \"claude-3-5-sonnet\",\n \"tools\": [{ \"name\": \"bash\", \"description\": \"run shell commands\" }],\n \"tool_calls\": [{ \"id\": \"t1\", \"name\": \"bash\", \"arguments\": {} }],\n \"estimated_input_tokens\": 1200,\n \"budget_remaining_usd\": 4.25,\n \"risk_tier\": \"Low\",\n \"dlp_findings\": [{ \"category\": \"secret\", \"pattern_name\": \"aws_access_key\", \"action\": \"redact\", \"offset\": 0, \"length\": 20 }],\n \"tool_sequence\": [\"read_file\", \"bash\"]\n}\n```\n\n`risk_tier` is one of `Low | Medium | High | Critical`. Return an `i32` verdict: `0` = ALLOW, `1` = BLOCK, `3` = REASK (refuse this attempt, tell the agent why, let it retry). `2` is deprecated \u2014 the guest never receives the request body, so redaction was never expressible; the proxy maps it to a block. Prefer `3` over `1` for any finding that is a pattern match, because pattern matches produce false positives.\n\n## 2. Author\n\nStart from the `@intutic/wasm-sdk` template (`packages/wasm-sdk/` in the open-core repo). Add one function per business rule and call it from `runRules()` in `assembly/index.ts`.\n\nSandbox constraints \u2014 a rule that breaks one reaches no verdict, and every call it could not judge is refused with `GOVERNANCE_UNAVAILABLE`, whatever the proxy's fail setting:\n\n- 1,000,000 fuel (instructions), the limit to write against; a 1 s wall-clock backstop; 16 MB memory.\n- Keep logic simple: no unbounded loops over `arguments`, no recursion, no I/O (none exists in the sandbox).\n- Host imports are limited to `env.log_info`, `env.trace`, `env.abort` and `env.read_referenced_file` (reads the bytes of a file the host already resolved before the sandbox existed \u2014 not a filesystem import, and it cannot be used to browse). A rule importing anything else cannot link, so it is refused at `intutic policy install` and refused again when the proxy loads it.\n- **`Math.random()` is unavailable.** AssemblyScript compiles it to an `env.seed` import the proxy does not provide. This list previously named `env.seed`, and a rule using randomness installed clean and then failed to link on every request \u2014 enforcing nothing, silently. Beyond the missing import, a verdict that samples is not a verdict: the same request would get different answers, and the audit trail would not explain either.\n\n## 3. Compile\n\n```bash\nintutic policy compile --src assembly/index.ts --out build/rule.wasm\n```\n\nRequires AssemblyScript in the project: `pnpm add -D assemblyscript assemblyscript-json`.\n\n## 4. Dry-run \u2014 required before install\n\nAuthor BOTH mock contexts and verify both outcomes before installing:\n\n```bash\nintutic policy test --wasm build/rule.wasm --mock should-block.json\nintutic policy test --wasm build/rule.wasm --mock should-allow.json\n```\n\nThe first must report BLOCK, the second ALLOW. A rule that blocks everything is as broken as one that blocks nothing.\n\n## 5. Install\n\n```bash\nintutic policy install --wasm build/rule.wasm --name block-prod-db --priority 50\nintutic policy list-local\n```\n\nRules install to `~/.intutic/wasm/` as `NN_name.wasm` (lower `NN` runs first; default 100). The proxy picks up changes within ~5 s on the next request \u2014 no restart needed.\n\n## 6. Guardrails\n\n- **Never embed secrets** (API keys, tokens, passwords) in rule sources or mock contexts \u2014 `intutic skill audit` flags them.\n- **Local rules cannot weaken central rules.** Verdicts merge most-restrictive-wins: a BLOCK from any rule \u2014 local or centrally synced \u2014 ends the request. \"Allow-override\" rules are no-ops by design; do not author them.\n- Keep rule sources (`assembly/*.ts`, mock JSON files) in version control alongside the workspace.\n";
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- **Authenticate:** `intutic login [--control-plane-url <url>]` (authenticates with your Intutic control plane).\n- **Initialize Workspace:** `intutic init` (detects the developer harnesses in the workspace, like Claude Code or Cursor, and records them for sync).\n- **Start Connection:** `intutic connect` (boots the local interceptor proxy, writes each recorded harness's rules and hooks, keeps them in sync with the control plane, and writes this skill and the rule-author skill into `.agents/skills/` when they are missing).\n- **Stop Governing:** `intutic disconnect [--harness <id>] [--dry-run] [--keep-login]` (undoes `connect` on this machine: restores every harness config it changed, removes its hooks, services and the skills it wrote, and logs out). Run it only when the user asks; `--dry-run` shows what would change.\n- **Offline Spend Sync:** The sync daemon automatically reconciles offline query consumption logs (`traces-*.jsonl`) and local budgets back to the control plane on reconnect.\n\n### 2. Traces & Auditing\n- **Check Budget:** `intutic budget` (displays overall monthly/daily spend limits, local spend caps, and active task loops).\n- **List Sessions:** `intutic traces list`\n- **Inspect Session Trace:** `intutic traces inspect <trace_id>`\n- **Push SOP Rules:** `intutic sops push <name>` (promotes local SOP rules to central repository).\n\n### 3. Governed Task Loops\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:* Pulls open tickets from linked task providers (Jira, Linear, GitHub Issues) and recommends ticket candidates for the session.\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:* Runs a deep heuristic prompt quality evaluation to grade clarity, specificity, and actionability.\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: `intutic decision approve <holdId>` or `intutic decision reject <holdId>`, or the Slack card. A developer cannot approve their own hold.\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.\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: 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---\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 automatically updated by `intutic connect`. 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`. The sync daemon uploads them automatically on connect via `/api/v1/traces/sync-back` and cleans up the local files. Rules can be promoted workspace-wide via `intutic sops push <name>`.\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- **Authenticate:** `intutic login [--control-plane-url <url>]` (authenticates with your Intutic control plane).\n- **Initialize Workspace:** `intutic init` (detects the developer harnesses in the workspace, like Claude Code or Cursor, and records them for sync).\n- **Start Connection:** `intutic connect` (boots the local interceptor proxy, writes each recorded harness's rules and hooks, keeps them in sync with the control plane, and writes this skill and the rule-author skill into `.agents/skills/` when they are missing).\n- **Stop Governing:** `intutic disconnect [--harness <id>] [--dry-run] [--keep-login]` (undoes `connect` on this machine: restores every harness config it changed, removes its hooks, services and the skills it wrote, and logs out). Run it only when the user asks; `--dry-run` shows what would change.\n- **Offline Spend Sync:** The sync daemon automatically reconciles offline query consumption logs (`traces-*.jsonl`) and local budgets back to the control plane on reconnect.\n\n### 2. Traces & Auditing\n- **Check Budget:** `intutic budget` (displays overall monthly/daily spend limits, local spend caps, and active task loops).\n- **List Sessions:** `intutic traces list`\n- **Inspect Session Trace:** `intutic traces inspect <trace_id>`\n- **Push SOP Rules:** `intutic sops push <name>` (promotes local SOP rules to central repository).\n\n### 3. Governed Task Loops\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: `intutic decision approve <holdId>` or `intutic decision reject <holdId>`, or the Slack card. A developer cannot approve their own hold.\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.\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 automatically updated by `intutic connect`. 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`. The sync daemon uploads them automatically on connect via `/api/v1/traces/sync-back` and cleans up the local files. Rules can be promoted workspace-wide via `intutic sops push <name>`.\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;AAMH,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,QAKlC,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,40KA2E7B,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,QAA+E,CAAA;AAE7G,sFAAsF;AACtF,eAAO,MAAM,YAAY,4lZAsHxB,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,86KA2E7B,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,QAA+E,CAAA;AAE7G,sFAAsF;AACtF,eAAO,MAAM,YAAY,4haAyHxB,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"}
@@ -24,6 +24,7 @@
24
24
  import * as node_fs from 'node:fs/promises';
25
25
  import * as node_path from 'node:path';
26
26
  import { keepOriginal, noteWritten } from './disconnect/originals.js';
27
+ import { writeFileAtomic } from './lib/atomicWrite.js';
27
28
  /** Workspace-relative path the rule-author skill is written to. */
28
29
  export const RULE_AUTHOR_SKILL_PATH = node_path.join('.agents', 'skills', 'intutic-rule-author', 'SKILL.md');
29
30
  /** Embedded copy of .agents/skills/intutic-rule-author/SKILL.md (canonical). */
@@ -36,7 +37,7 @@ description: Convert natural-language business rules into compiled WASM governan
36
37
 
37
38
  Use this skill whenever the user states a rule that AI agent traffic must obey — "block any agent call that touches the prod database", "kill requests once the session budget drops below $1", "never allow shell tool calls containing rm -rf". You convert the rule into an AssemblyScript policy, compile it to WebAssembly, dry-run it against mock contexts, and install it into the local Intutic proxy. The proxy hot-loads it within ~5 seconds and enforces it on every intercepted LLM request.
38
39
 
39
- **The other way you get here is \`/fix\`.** That proxy command scores the workspace's governance posture and, when it finds no custom policy, recommends: *"Add a WASM rule under \`~/.intutic/wasm\` to codify a custom guardrail."* When that recommendation is the prompt, the rule to author is the gap \`/fix\` found — ask the user which specific behaviour they want blocked rather than writing a generic rule, then run \`/fix\` again after installing to confirm the posture score moved. If it did not, the rule is not loading: check \`intutic policy list-local\` and the sandbox constraints in §2, since a rule that violates them is silently disabled.
40
+ **The other way you get here is \`/fix\`.** That proxy command scores the workspace's governance posture and, when it finds no custom policy, recommends: *"Add a WASM rule under \`~/.intutic/wasm\` to codify a custom guardrail."* When that recommendation is the prompt, the rule to author is the gap \`/fix\` found — ask the user which specific behaviour they want blocked rather than writing a generic rule, then run \`/fix\` again after installing to confirm the posture score moved. If it did not, the rule is not loading: check \`intutic policy list-local\` and the sandbox constraints in §2. A rule that breaks them is not skipped silently: it reaches no verdict, and every request it could not judge is refused with \`GOVERNANCE_UNAVAILABLE\`.
40
41
 
41
42
  ## 1. The contract your rule sees
42
43
 
@@ -100,7 +101,7 @@ Rules install to \`~/.intutic/wasm/\` as \`NN_name.wasm\` (lower \`NN\` runs fir
100
101
  ## 6. Guardrails
101
102
 
102
103
  - **Never embed secrets** (API keys, tokens, passwords) in rule sources or mock contexts — \`intutic skill audit\` flags them.
103
- - **Local rules cannot weaken central rules.** Verdicts merge most-restrictive-wins: a KILL from any rule — local or centrally synced — ends the request. "Allow-override" rules are no-ops by design; do not author them.
104
+ - **Local rules cannot weaken central rules.** Verdicts merge most-restrictive-wins: a BLOCK from any rule — local or centrally synced — ends the request. "Allow-override" rules are no-ops by design; do not author them.
104
105
  - Keep rule sources (\`assembly/*.ts\`, mock JSON files) in version control alongside the workspace.
105
106
  `;
106
107
  /** Workspace-relative path the Kitkat skill is written to. */
@@ -148,7 +149,7 @@ When interacting with LLM providers through the local proxy, prepend requests wi
148
149
 
149
150
  ### 1. Cost & Task Attribution
150
151
  - **Initialize Picker:** \`@intutic initialize\`
151
- - *Description:* Pulls open tickets from linked task providers (Jira, Linear, GitHub Issues) and recommends ticket candidates for the session.
152
+ - *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.
152
153
  - **Lock Session & Scope Rules:** \`@intutic start [<ticket_id>] [--sops=<names_or_indices>] [--auto-judge]\`
153
154
  - *Description:* Attributes token costs to a ticket (optional) and scopes active local SOP directories for governance.
154
155
  - *Examples:*
@@ -165,7 +166,7 @@ When interacting with LLM providers through the local proxy, prepend requests wi
165
166
  - **Verify Prompt:** \`@intutic verify <prompt>\` (or \`@intutic check <prompt>\`)
166
167
  - *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.
167
168
  - **Review Prompt:** \`@intutic review <prompt>\`
168
- - *Description:* Runs a deep heuristic prompt quality evaluation to grade clarity, specificity, and actionability.
169
+ - *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.
169
170
  - **Judge Response:** \`@intutic judge <prompt>\`
170
171
  - *Description:* Submits the prompt to the upstream LLM and evaluates the response stream in parallel using LLM-as-a-judge compliance checkers.
171
172
  - *Note:* If no prompt is provided (e.g. \`@intutic judge\`), returns usage instructions.
@@ -209,11 +210,14 @@ Continue without it, or tell the user what would have to change and who can chan
209
210
  - **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.
210
211
 
211
212
  ### Not checked: retry once, later
212
- \`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: governance could not check the call, so it did not run. One later retry is fine; if it fails again, tell the user.
213
+ \`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.
213
214
 
214
215
  ### Ran, but the result was withheld
215
216
  \`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.
216
217
 
218
+ ### Injected by an experiment
219
+ \`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.
220
+
217
221
  ---
218
222
 
219
223
  ## 🛡️ Policy & Hook Verification
@@ -249,7 +253,7 @@ export async function writeBundledSkills(workspaceRoot) {
249
253
  // directories it needed) and can tell a later edit apart.
250
254
  await keepOriginal(dest, workspaceRoot);
251
255
  await node_fs.mkdir(node_path.dirname(dest), { recursive: true });
252
- await node_fs.writeFile(dest, skill.content, 'utf-8');
256
+ await writeFileAtomic(dest, skill.content);
253
257
  await noteWritten(dest, workspaceRoot, skill.content);
254
258
  written.push(dest);
255
259
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skillWriter.js","sourceRoot":"","sources":["../src/skillWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAA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AC,CAAA;IACpB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1,18 +1,34 @@
1
1
  /**
2
- * Trajectory Monitor — Daemon-side session watcher (Worker Thread).
2
+ * Trajectory Monitor — Daemon-side session watcher.
3
3
  *
4
- * Runs inside the sync-daemon as a Node.js Worker thread. Subscribes to
5
- * Valkey pub/sub `trace:live:{sessionId}` channels, buffers events in a
6
- * sliding window, and submits trajectory summaries to the control plane
7
- * for analysis.
4
+ * Runs in the `intutic connect` process, not a Worker thread:
5
+ * `tools/cli/src/commands/connect.ts` subscribes to the Valkey pub/sub
6
+ * `trace:live:*` channels and passes each event to `handleTraceEvent`. Events
7
+ * are buffered per session in a sliding window, and trajectory summaries are
8
+ * submitted to the control plane for analysis.
8
9
  *
9
10
  * Key guarantees:
10
- * - Non-blocking: Worker thread isolation, fire-and-forget analysis
11
+ * - Non-blocking: summaries go out asynchronously on a timer, with a 10s
12
+ * HTTP timeout, and the monitor is separate from the proxy process
11
13
  * - No LLM calls on developer machine (all judgment is server-side)
12
14
  * - Cooldown rate limiter: 1 analysis request per minute per session
13
15
  *
14
16
  * @module
15
17
  */
18
+ /**
19
+ * Whether a summary the control plane refused with `status` may be accepted
20
+ * later, and so belongs in the offline spool.
21
+ *
22
+ * A 4xx is the control plane's answer about the summary or the caller (a
23
+ * malformed body, a VIEWER key, a workspace that is not the key's), and the
24
+ * same line would be refused on every retry until the spool's size cap — so it
25
+ * is dropped. 408 and 429 are about timing and are retried, as are 5xx and
26
+ * network errors. 401 is retried too: the control plane answers 401 for any
27
+ * failure in its auth middleware, a database error on a key-cache miss
28
+ * included, and `/healthz` (the drain's reachability probe) does not touch the
29
+ * database, so a 401 can mean "down", not "never".
30
+ */
31
+ export declare function isRetryableRefusal(status: number): boolean;
16
32
  /** Individual trace event from the proxy pub/sub stream. */
17
33
  export interface TraceEvent {
18
34
  sessionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"trajectoryMonitor.d.ts","sourceRoot":"","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AAC,OAAO,CAAsC;IACrD,OAAO,CAAC,WAAW,CAA8C;IACjE,OAAO,CAAC,OAAO,CAAQ;gBAEM,MAAM,EAAE,uBAAuB;IAE5D;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB5B;;OAEG;IACH,IAAI,IAAI,IAAI;IAUZ;;;OAGG;IACH,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA4BzC;;OAEG;YACW,kBAAkB;IAmBhC;;OAEG;YACW,aAAa;IAmE3B,OAAO,CAAC,WAAW;YAoBL,wBAAwB;IAgEtC,mEAAmE;YACrD,uBAAuB;IAUrC,gDAAgD;IAChD,IAAI,kBAAkB,IAAI,MAAM,CAE/B;CACF"}
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Trajectory Monitor — Daemon-side session watcher (Worker Thread).
2
+ * Trajectory Monitor — Daemon-side session watcher.
3
3
  *
4
- * Runs inside the sync-daemon as a Node.js Worker thread. Subscribes to
5
- * Valkey pub/sub `trace:live:{sessionId}` channels, buffers events in a
6
- * sliding window, and submits trajectory summaries to the control plane
7
- * for analysis.
4
+ * Runs in the `intutic connect` process, not a Worker thread:
5
+ * `tools/cli/src/commands/connect.ts` subscribes to the Valkey pub/sub
6
+ * `trace:live:*` channels and passes each event to `handleTraceEvent`. Events
7
+ * are buffered per session in a sliding window, and trajectory summaries are
8
+ * submitted to the control plane for analysis.
8
9
  *
9
10
  * Key guarantees:
10
- * - Non-blocking: Worker thread isolation, fire-and-forget analysis
11
+ * - Non-blocking: summaries go out asynchronously on a timer, with a 10s
12
+ * HTTP timeout, and the monitor is separate from the proxy process
11
13
  * - No LLM calls on developer machine (all judgment is server-side)
12
14
  * - Cooldown rate limiter: 1 analysis request per minute per session
13
15
  *
@@ -31,6 +33,24 @@ const log = createLogger('trajectory-monitor');
31
33
  * `saveOffline` was previously called with no ceiling at all.
32
34
  */
33
35
  const MAX_OFFLINE_TRAJECTORIES_BYTES = 16 * 1024 * 1024;
36
+ /**
37
+ * Whether a summary the control plane refused with `status` may be accepted
38
+ * later, and so belongs in the offline spool.
39
+ *
40
+ * A 4xx is the control plane's answer about the summary or the caller (a
41
+ * malformed body, a VIEWER key, a workspace that is not the key's), and the
42
+ * same line would be refused on every retry until the spool's size cap — so it
43
+ * is dropped. 408 and 429 are about timing and are retried, as are 5xx and
44
+ * network errors. 401 is retried too: the control plane answers 401 for any
45
+ * failure in its auth middleware, a database error on a key-cache miss
46
+ * included, and `/healthz` (the drain's reachability probe) does not touch the
47
+ * database, so a 401 can mean "down", not "never".
48
+ */
49
+ export function isRetryableRefusal(status) {
50
+ if (status < 400 || status >= 500)
51
+ return true;
52
+ return status === 401 || status === 408 || status === 429;
53
+ }
34
54
  // ─── Sliding Window Buffer ──────────────────────────────────────────
35
55
  /**
36
56
  * Per-session sliding window buffer for trace events.
@@ -167,8 +187,8 @@ export class TrajectoryMonitor {
167
187
  this.submitTimer = setInterval(() => {
168
188
  void this.submitAllSummaries();
169
189
  }, submitIntervalMs);
170
- // Note: Valkey subscription is handled by the sync-daemon's existing
171
- // Redis subscriber. Events are forwarded to this worker via postMessage.
190
+ // Note: the Valkey subscription lives in the caller (`connect.ts`), which
191
+ // passes each trace:live event to handleTraceEvent.
172
192
  }
173
193
  /**
174
194
  * Stop the monitor and clean up resources.
@@ -255,6 +275,10 @@ export class TrajectoryMonitor {
255
275
  });
256
276
  buffer.markSubmitted();
257
277
  if (!res.ok) {
278
+ if (!isRetryableRefusal(res.status)) {
279
+ log.warn({ sessionId: buffer.sessionId, status: res.status }, `Trajectory submission refused: ${res.status}, dropped (a retry would be refused too)`);
280
+ return;
281
+ }
258
282
  log.warn({ sessionId: buffer.sessionId, status: res.status }, `Trajectory submission failed: ${res.status}, buffering offline`);
259
283
  this.saveOffline(summary, offlineFile);
260
284
  return;
@@ -306,8 +330,10 @@ export class TrajectoryMonitor {
306
330
  log.info({ count: lines.length }, 'Attempting to drain offline trajectories');
307
331
  const remaining = [];
308
332
  for (const line of lines) {
333
+ let sessionId;
309
334
  try {
310
335
  const summary = JSON.parse(line);
336
+ sessionId = summary?.sessionId;
311
337
  const res = await fetch(`${this.config.controlPlaneUrl}/api/v1/trajectory/analyze`, {
312
338
  method: 'POST',
313
339
  headers: {
@@ -318,7 +344,12 @@ export class TrajectoryMonitor {
318
344
  signal: AbortSignal.timeout(5000),
319
345
  });
320
346
  if (!res.ok) {
321
- remaining.push(line);
347
+ if (isRetryableRefusal(res.status)) {
348
+ remaining.push(line);
349
+ }
350
+ else {
351
+ log.warn({ sessionId: typeof sessionId === 'string' ? sessionId : undefined, status: res.status }, `Offline trajectory refused: ${res.status}, dropped from the spool (a retry would be refused too)`);
352
+ }
322
353
  }
323
354
  }
324
355
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"trajectoryMonitor.js","sourceRoot":"","sources":["../src/trajectoryMonitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAE7E,MAAM,GAAG,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,8BAA8B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AA+CvD,uEAAuE;AAEvE;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAOhB;IACA;IAPH,MAAM,GAAiB,EAAE,CAAA;IAChB,OAAO,CAAQ;IACf,QAAQ,CAAQ;IACzB,cAAc,GAAG,CAAC,CAAA;IAE1B,YACW,SAAiB,EACjB,WAAmB,EAC5B,OAAO,GAAG,GAAG,EACb,QAAQ,GAAG,OAAO;QAHT,cAAS,GAAT,SAAS,CAA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ks } from '../harness/n8nHooks.js';
48
48
  import { writeOpenWebuiHooks } from '../harness/openWebuiHooks.js';
49
49
  import { GATE_ARTIFACTS } from '../harness/gateArtifacts.js';
50
50
  import { isImmutable } from '../harness/gooseHardener.js';
51
- import { readOriginal } from '../disconnect/originals.js';
51
+ import { readOriginal, sha256 } from '../disconnect/originals.js';
52
52
  import { DEFAULT_SNAPSHOT_DIR, SNAPSHOT_JSON, SNAPSHOT_RULES, restoreVerifiedSnapshot } from '../lib/policySnapshot.js';
53
53
  import { repairHookSettings } from './vscodeHookSettings.js';
54
+ import { writeFileAtomic } from '../lib/atomicWrite.js';
54
55
  const log = createLogger('sync-settings-guard');
55
56
  /** Marker embedded in every Intutic-generated hook command. */
56
57
  const HOOK_MARKER = '.intutic/hooks/';
@@ -296,6 +297,14 @@ export async function guardSettingsFile(changedPath, workspaceRoot, sops, proxyU
296
297
  if (changedPath.includes(path.join('.agents', 'plugins', 'intutic-governance'))) {
297
298
  if (skip.has('goose'))
298
299
  return false;
300
+ // Holding exactly what the writer last put there: the daemon's own
301
+ // regeneration (it unhardens, writes and hardens again, and the watcher
302
+ // sees the change after), not an override. Checked before the immutable
303
+ // flag, because where the flag cannot be set (Linux without root) the
304
+ // file is never immutable and the restore path below would treat every
305
+ // regeneration, a gate upgrade included, as tampering too.
306
+ if (await isLastWritten(changedPath, workspaceRoot))
307
+ return false;
299
308
  if (await isImmutable(changedPath)) {
300
309
  log.error({ action: 'governance_override_attempt', path: changedPath }, 'SECURITY: Immutable Goose governance file was modified — OS immutable flag bypassed. Emitting incident.');
301
310
  // The workspace's log, which the daemon drains; one under the home
@@ -477,7 +486,7 @@ async function guardVsCodeHookSettings(filePath, workspaceRoot) {
477
486
  if (!repaired)
478
487
  return false;
479
488
  try {
480
- await fs.writeFile(filePath, repaired.text, 'utf-8');
489
+ await writeFileAtomic(filePath, repaired.text, { followSymlink: true });
481
490
  }
482
491
  catch (err) {
483
492
  log.error({ action: 'vscode_hook_settings_restore_failed', path: filePath, err }, 'Could not restore the VS Code hook settings');
@@ -550,6 +559,18 @@ function gateRegistrations(workspaceRoot) {
550
559
  { harness: 'openclaw', file: path.join(home, '.openclaw', 'openclaw.json'), gate: openclawPlugin, marker: openclawPlugin },
551
560
  ];
552
561
  }
562
+ /** Whether `file` holds the bytes Intutic last wrote to it, by the disconnect ledger. */
563
+ async function isLastWritten(file, workspaceRoot) {
564
+ const written = (await readOriginal(file, workspaceRoot))?.writtenSha256;
565
+ if (!written)
566
+ return false;
567
+ try {
568
+ return sha256(await fs.readFile(file)) === written;
569
+ }
570
+ catch {
571
+ return false;
572
+ }
573
+ }
553
574
  /**
554
575
  * A gate file: deleted, or no longer the generated gate, and its writer runs
555
576
  * again. Cline runs its hook only while the file is executable, so for Cline