@datafog/fogclaw 0.2.0 → 0.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 (103) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/backlog-tools.d.ts +57 -0
  3. package/dist/backlog-tools.d.ts.map +1 -0
  4. package/dist/backlog-tools.js +173 -0
  5. package/dist/backlog-tools.js.map +1 -0
  6. package/dist/backlog.d.ts +82 -0
  7. package/dist/backlog.d.ts.map +1 -0
  8. package/dist/backlog.js +169 -0
  9. package/dist/backlog.js.map +1 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +6 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +87 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/message-sending-handler.d.ts +2 -1
  18. package/dist/message-sending-handler.d.ts.map +1 -1
  19. package/dist/message-sending-handler.js +5 -1
  20. package/dist/message-sending-handler.js.map +1 -1
  21. package/dist/tool-result-handler.d.ts +2 -1
  22. package/dist/tool-result-handler.d.ts.map +1 -1
  23. package/dist/tool-result-handler.js +5 -1
  24. package/dist/tool-result-handler.js.map +1 -1
  25. package/dist/types.d.ts +15 -0
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/types.js.map +1 -1
  28. package/openclaw.plugin.json +11 -1
  29. package/package.json +7 -1
  30. package/.github/workflows/harness-docs.yml +0 -30
  31. package/AGENTS.md +0 -28
  32. package/docs/DATA.md +0 -28
  33. package/docs/DESIGN.md +0 -17
  34. package/docs/DOMAIN_DOCS.md +0 -30
  35. package/docs/FRONTEND.md +0 -24
  36. package/docs/OBSERVABILITY.md +0 -32
  37. package/docs/PLANS.md +0 -171
  38. package/docs/PRODUCT_SENSE.md +0 -20
  39. package/docs/RELIABILITY.md +0 -60
  40. package/docs/SECURITY.md +0 -52
  41. package/docs/design-docs/core-beliefs.md +0 -17
  42. package/docs/design-docs/index.md +0 -8
  43. package/docs/generated/README.md +0 -36
  44. package/docs/generated/memory.md +0 -1
  45. package/docs/plans/2026-02-16-fogclaw-design.md +0 -172
  46. package/docs/plans/2026-02-16-fogclaw-implementation.md +0 -1606
  47. package/docs/plans/README.md +0 -15
  48. package/docs/plans/active/2026-02-16-feat-openclaw-official-submission-plan.md +0 -386
  49. package/docs/plans/active/2026-02-17-feat-release-fogclaw-via-datafog-package-plan.md +0 -328
  50. package/docs/plans/active/2026-02-17-feat-submit-fogclaw-to-openclaw-plan.md +0 -244
  51. package/docs/plans/active/2026-02-17-feat-tool-result-pii-scanning-plan.md +0 -293
  52. package/docs/plans/tech-debt-tracker.md +0 -42
  53. package/docs/plugins/fogclaw.md +0 -101
  54. package/docs/runbooks/address-review-findings.md +0 -30
  55. package/docs/runbooks/ci-failures.md +0 -46
  56. package/docs/runbooks/code-review.md +0 -34
  57. package/docs/runbooks/merge-change.md +0 -28
  58. package/docs/runbooks/pull-request.md +0 -45
  59. package/docs/runbooks/record-evidence.md +0 -43
  60. package/docs/runbooks/reproduce-bug.md +0 -42
  61. package/docs/runbooks/respond-to-feedback.md +0 -42
  62. package/docs/runbooks/review-findings.md +0 -31
  63. package/docs/runbooks/submit-openclaw-plugin.md +0 -68
  64. package/docs/runbooks/update-agents-md.md +0 -59
  65. package/docs/runbooks/update-domain-docs.md +0 -42
  66. package/docs/runbooks/validate-current-state.md +0 -41
  67. package/docs/runbooks/verify-release.md +0 -69
  68. package/docs/specs/2026-02-16-feat-openclaw-official-submission-spec.md +0 -115
  69. package/docs/specs/2026-02-17-feat-outbound-message-pii-scanning-spec.md +0 -93
  70. package/docs/specs/2026-02-17-feat-submit-fogclaw-to-openclaw.md +0 -125
  71. package/docs/specs/2026-02-17-feat-tool-result-pii-scanning-spec.md +0 -122
  72. package/docs/specs/README.md +0 -5
  73. package/docs/specs/index.md +0 -8
  74. package/docs/spikes/README.md +0 -8
  75. package/fogclaw.config.example.json +0 -33
  76. package/scripts/ci/he-docs-config.json +0 -123
  77. package/scripts/ci/he-docs-drift.sh +0 -112
  78. package/scripts/ci/he-docs-lint.sh +0 -234
  79. package/scripts/ci/he-plans-lint.sh +0 -354
  80. package/scripts/ci/he-runbooks-lint.sh +0 -445
  81. package/scripts/ci/he-specs-lint.sh +0 -258
  82. package/scripts/ci/he-spikes-lint.sh +0 -249
  83. package/scripts/runbooks/select-runbooks.sh +0 -154
  84. package/src/config.ts +0 -183
  85. package/src/engines/gliner.ts +0 -240
  86. package/src/engines/regex.ts +0 -71
  87. package/src/extract.ts +0 -98
  88. package/src/index.ts +0 -381
  89. package/src/message-sending-handler.ts +0 -87
  90. package/src/redactor.ts +0 -51
  91. package/src/scanner.ts +0 -196
  92. package/src/tool-result-handler.ts +0 -133
  93. package/src/types.ts +0 -75
  94. package/tests/config.test.ts +0 -78
  95. package/tests/extract.test.ts +0 -185
  96. package/tests/gliner.test.ts +0 -289
  97. package/tests/message-sending-handler.test.ts +0 -244
  98. package/tests/plugin-smoke.test.ts +0 -250
  99. package/tests/redactor.test.ts +0 -320
  100. package/tests/regex.test.ts +0 -345
  101. package/tests/scanner.test.ts +0 -348
  102. package/tests/tool-result-handler.test.ts +0 -329
  103. package/tsconfig.json +0 -20
@@ -1,293 +0,0 @@
1
- ---
2
- slug: 2026-02-17-feat-tool-result-pii-scanning
3
- status: active
4
- phase: plan
5
- plan_mode: lightweight
6
- detail_level: more
7
- priority: high
8
- owner: sidmohan
9
- ---
10
-
11
- # Add PII scanning to tool results via tool_result_persist hook
12
-
13
- This Plan is a living document. Keep `Progress`, `Surprises & Discoveries`, `Decision Log`, `Outcomes & Retrospective`, and `Revision Notes` current as work proceeds.
14
-
15
- This plan must be maintained in accordance with `docs/PLANS.md`.
16
-
17
- ## Purpose / Big Picture
18
-
19
- FogClaw currently scans only the user prompt for PII. When an agent reads a file, fetches a web page, or queries an API, the tool result flows into the session transcript unscanned. After this change, FogClaw will intercept every tool result via OpenClaw's `tool_result_persist` hook and redact PII spans (SSN, email, phone, credit card, IP address, date, zip code) before the content is persisted to the session. The agent will see `[SSN_1]` instead of `123-45-6789`.
20
-
21
- To verify it works: install FogClaw in OpenClaw, ask the agent to read a file that contains a phone number and an SSN, then inspect the session transcript. The raw values should be replaced with redaction tokens.
22
-
23
- ## Progress
24
-
25
- - [x] (2026-02-17T17:28:00Z) P1 [M1] Create `src/extract.ts` with `extractText` and `replaceText` functions
26
- - [x] (2026-02-17T17:28:00Z) P2 [M1] Create `tests/extract.test.ts` covering string content, content block arrays, nested structures, empty/null, and non-text types
27
- - [x] (2026-02-17T17:28:00Z) P3 [M1] All extract tests pass — 27 tests passed
28
- - [x] (2026-02-17T17:29:00Z) P4 [M2] Create `src/tool-result-handler.ts` with synchronous `createToolResultHandler` factory
29
- - [x] (2026-02-17T17:29:00Z) P5 [M2] Create `tests/tool-result-handler.test.ts` covering scanning, redaction, audit logging, allowlist, and edge cases
30
- - [x] (2026-02-17T17:29:00Z) P6 [M2] Register `tool_result_persist` hook in `src/index.ts`
31
- - [x] (2026-02-17T17:29:00Z) P7 [M2] All tool-result-handler tests pass — 21 tests passed
32
- - [x] (2026-02-17T17:30:00Z) P8 [M3] Extend `tests/plugin-smoke.test.ts` with `tool_result_persist` hook registration and transformation tests
33
- - [x] (2026-02-17T17:30:00Z) P9 [M3] Full test suite passes — 149 tests, 8 files, 0 failures
34
- - [x] (2026-02-17T17:30:00Z) P10 [M3] Commit all changes — 3b7564f
35
-
36
- ## Surprises & Discoveries
37
-
38
- - Observation: The Scanner class's `regexEngine` field is private, so we instantiated a fresh `RegexEngine` directly in `register()` rather than exposing the Scanner's internal instance.
39
- Evidence: `const toolResultRegex = new RegexEngine();` in src/index.ts. RegexEngine is stateless (only uses pattern matching), so a separate instance is functionally identical.
40
-
41
- - Observation: The null byte separator approach for multi-block content works cleanly — regex PII patterns never match across `\0` boundaries.
42
- Evidence: 27 extract tests pass including multi-block scenarios with mixed text/image blocks.
43
-
44
- ## Decision Log
45
-
46
- - Decision: Use RegexEngine and redact() directly instead of going through Scanner
47
- Rationale: Scanner.scan() is declared `async` (returns a Promise) even when GLiNER is disabled, because the method signature is `async scan(...)`. The `tool_result_persist` hook in OpenClaw is synchronous-only — if a handler returns a Promise, OpenClaw logs a warning and ignores the result. RegexEngine.scan() and redact() are both fully synchronous, so we call them directly.
48
- Date/Author: 2026-02-17, sidmohan
49
-
50
- - Decision: All guardrail modes (redact, block, warn) produce span-level redaction in tool results
51
- Rationale: Unlike `before_agent_start` where "block" can only prepend a warning context, `tool_result_persist` actually transforms the message. Span-level redaction is the safest behavior — it removes the PII while preserving surrounding context that the agent needs to reason. Replacing the entire tool result would destroy useful non-PII information.
52
- Date/Author: 2026-02-17, sidmohan
53
-
54
- - Decision: Reuse existing FogClaw config (guardrail_mode, entityActions, redactStrategy, allowlist)
55
- Rationale: Users should have one mental model — "I set SSN to block, and it's blocked everywhere." Adding a separate config section for tool results would create inconsistency and confusion. If a user needs different behavior per-surface, that can be a future initiative.
56
- Date/Author: 2026-02-17, sidmohan
57
-
58
- ## Outcomes & Retrospective
59
-
60
- All three milestones completed. FogClaw now scans tool results for PII via `tool_result_persist` hook using the regex engine synchronously. 149 tests pass across 8 test files with zero regressions. New modules: `src/extract.ts` (text extraction/replacement), `src/tool-result-handler.ts` (synchronous handler factory). The implementation adds 52 new tests (27 extract + 21 handler + 4 smoke).
61
-
62
- ## Context and Orientation
63
-
64
- FogClaw is an OpenClaw plugin that detects and redacts PII in agent conversations. The plugin lives at `/Users/sidmohan/Projects/datafog/fogclaw`.
65
-
66
- Key files relevant to this plan:
67
-
68
- - `src/index.ts` — Plugin entry point. Exports a plugin object with `id`, `name`, and `register(api)`. The `register` function loads config, initializes the Scanner, registers the `before_agent_start` hook, and registers three tools (`fogclaw_scan`, `fogclaw_preview`, `fogclaw_redact`). This is where we will add the `tool_result_persist` hook registration.
69
-
70
- - `src/engines/regex.ts` — The RegexEngine class. Has a `scan(text: string): Entity[]` method that is fully synchronous. Detects 7 PII types: EMAIL, PHONE, SSN, CREDIT_CARD, IP_ADDRESS, DATE, ZIP_CODE. Each match gets confidence 1.0 and source "regex".
71
-
72
- - `src/redactor.ts` — The `redact(text, entities, strategy)` function. Fully synchronous. Takes text, detected entities, and a strategy ("token", "mask", or "hash"). Returns `{ redacted_text, mapping, entities }`. Sorts entities by position descending and replaces from end to start to avoid offset corruption.
73
-
74
- - `src/types.ts` — Type definitions including `Entity`, `RedactStrategy`, `GuardrailAction`, `FogClawConfig`, `ScanResult`, `RedactResult`. Also has `canonicalType()` for normalizing entity labels and `CANONICAL_TYPE_MAP`.
75
-
76
- - `src/config.ts` — `loadConfig(raw)` merges defaults with overrides and validates. The `FogClawConfig` type includes `guardrail_mode`, `entityActions`, `redactStrategy`, `allowlist`, `auditEnabled`, and others.
77
-
78
- - `src/scanner.ts` — The `Scanner` class that orchestrates regex + GLiNER engines. Its `scan()` method is `async` (cannot be used in synchronous hooks). Includes `filterByPolicy()` which applies allowlist filtering — we will need to replicate or extract this logic for the synchronous path.
79
-
80
- - `tests/plugin-smoke.test.ts` — Integration tests for the plugin contract. Creates a mock `api` object with `pluginConfig`, `logger`, `on()`, and `registerTool()`. Tests verify hook registration and tool behavior.
81
-
82
- OpenClaw's `tool_result_persist` hook contract (from OpenClaw's `src/plugins/types.ts`):
83
-
84
- - **Event type**: `{ toolName?: string, toolCallId?: string, message: AgentMessage, isSynthetic?: boolean }`
85
- - **Context type**: `{ agentId?: string, sessionKey?: string, toolName?: string, toolCallId?: string }`
86
- - **Result type**: `{ message?: AgentMessage }` — return a modified message, or void to leave it unchanged
87
- - **Execution**: Synchronous only. If a handler returns a Promise, OpenClaw warns and ignores the result.
88
- - **Where it runs**: Inside `SessionManager.appendMessage`, via `session-tool-result-guard-wrapper.ts`. Fires on every tool result before it is written to the session transcript.
89
-
90
- The `AgentMessage` type varies by provider and tool, but tool results typically contain text content in one of these shapes:
91
- - A plain string
92
- - An array of content blocks, each with `{ type: "text", text: string }` or `{ type: "image", ... }`
93
- - A structured object with a `content` property that is one of the above
94
-
95
- ## Milestones
96
-
97
- ### Milestone 1 — Text extraction and replacement utilities
98
-
99
- After this milestone, FogClaw will have a utility module that can defensively extract all text from an `AgentMessage` tool result payload (regardless of its internal shape) and replace text spans within it. This is the foundation for scanning — you need to get text out of the message to scan it, and put redacted text back in.
100
-
101
- The module will be at `src/extract.ts` with two exported functions:
102
-
103
- - `extractText(message: unknown): string` — walks the message structure and concatenates all text content into a single string, with segment boundaries marked so offsets can be mapped back. Returns empty string for non-text content.
104
- - `replaceText(message: unknown, redactedText: string): unknown` — takes the original message and a redacted version of the extracted text, and returns a new message object with text content replaced. Preserves the original structure (arrays of content blocks stay as arrays, etc.).
105
-
106
- Verification: run `pnpm test tests/extract.test.ts` and see all tests pass, covering: plain string messages, content block arrays with mixed text/image blocks, nested content properties, empty/null messages, and messages with no text content.
107
-
108
- ### Milestone 2 — Synchronous tool result handler
109
-
110
- After this milestone, FogClaw will have a handler factory at `src/tool-result-handler.ts` that produces a synchronous `tool_result_persist` handler, and the handler will be registered in `src/index.ts`.
111
-
112
- The factory function `createToolResultHandler(config, regexEngine, logger?)` returns a function with the signature `(event, ctx) => { message } | void`. The handler:
113
-
114
- 1. Extracts text from `event.message` using `extractText`
115
- 2. Scans text with `regexEngine.scan(text)` (synchronous)
116
- 3. Filters results through the allowlist (replicating `Scanner.filterByPolicy` logic synchronously)
117
- 4. Determines per-entity action from `config.entityActions` with `config.guardrail_mode` as fallback
118
- 5. Redacts all actionable entities using `redact()` (synchronous)
119
- 6. Replaces text in the message using `replaceText`
120
- 7. Emits an audit log entry if `config.auditEnabled` and entities were found
121
- 8. Returns `{ message: modifiedMessage }` if any redaction occurred, or `void` if no PII found
122
-
123
- The hook will be registered in `src/index.ts` inside the `register(api)` function, alongside the existing `before_agent_start` hook:
124
-
125
- api.on("tool_result_persist", handler);
126
-
127
- Verification: run `pnpm test tests/tool-result-handler.test.ts` and see all tests pass, covering: SSN redaction in tool results, email/phone detection, allowlist exclusion, audit log emission, no-op when no PII found, and various message shapes.
128
-
129
- ### Milestone 3 — Integration smoke test
130
-
131
- After this milestone, the existing plugin smoke test at `tests/plugin-smoke.test.ts` will be extended to verify that FogClaw registers a `tool_result_persist` hook and that invoking it with a tool result containing PII produces a transformed message.
132
-
133
- Verification: run `pnpm test` (full suite) and see all tests pass with no regressions.
134
-
135
- ## Plan of Work
136
-
137
- The work proceeds in three sequential steps. Each builds on the previous.
138
-
139
- **Step 1: Text extraction module.** Create `src/extract.ts` with `extractText` and `replaceText`. The `extractText` function should handle these `AgentMessage` shapes: (a) the message itself is a string, (b) the message has a `content` property that is a string, (c) the message has a `content` property that is an array of blocks where each text block has `{ type: "text", text: string }`. For arrays, concatenate text blocks with a newline separator and track the offset ranges so `replaceText` can map redacted text back to the correct blocks. Create `tests/extract.test.ts` with tests for each shape plus edge cases (null, undefined, empty string, image-only content blocks, deeply nested content).
140
-
141
- **Step 2: Tool result handler.** Create `src/tool-result-handler.ts`. Import `RegexEngine` from `src/engines/regex.ts`, `redact` from `src/redactor.ts`, `extractText`/`replaceText` from `src/extract.ts`, and types from `src/types.ts`. The factory function `createToolResultHandler` takes `FogClawConfig`, a `RegexEngine` instance, and an optional logger object. It returns a synchronous handler function. Inside the handler: extract text, scan, filter by allowlist (replicate the allowlist filtering logic from `Scanner.filterByPolicy` in `src/scanner.ts` — the filtering checks `config.allowlist.values`, `config.allowlist.patterns`, and `config.allowlist.entities`), determine actions, redact, replace, audit, return. Then update `src/index.ts` to call `createToolResultHandler` during registration and register the returned handler with `api.on("tool_result_persist", handler)`. Create `tests/tool-result-handler.test.ts`.
142
-
143
- **Step 3: Smoke test extension.** In `tests/plugin-smoke.test.ts`, add a test that verifies `tool_result_persist` appears in the registered hooks after `register(api)` is called. Add a second test that invokes the hook handler with a mock tool result message containing an SSN, and asserts the returned message has the SSN replaced with a redaction token like `[SSN_1]`.
144
-
145
- ## Concrete Steps
146
-
147
- All commands run from the FogClaw repo root at `/Users/sidmohan/Projects/datafog/fogclaw`.
148
-
149
- After creating `src/extract.ts` and `tests/extract.test.ts`:
150
-
151
- pnpm test tests/extract.test.ts
152
-
153
- Expected: all extract tests pass (text extraction from various message shapes, replacement, edge cases).
154
-
155
- After creating `src/tool-result-handler.ts` and `tests/tool-result-handler.test.ts` and updating `src/index.ts`:
156
-
157
- pnpm test tests/tool-result-handler.test.ts
158
-
159
- Expected: all handler tests pass (scanning, redaction, audit, allowlist, no-op cases).
160
-
161
- After extending `tests/plugin-smoke.test.ts`:
162
-
163
- pnpm test tests/plugin-smoke.test.ts
164
-
165
- Expected: all smoke tests pass, including new `tool_result_persist` tests.
166
-
167
- Full suite validation:
168
-
169
- pnpm test
170
-
171
- Expected: all tests pass, no regressions in existing `before_agent_start`, scanner, redactor, regex, or config tests.
172
-
173
- Type check:
174
-
175
- pnpm lint
176
-
177
- Expected: no type errors.
178
-
179
- ## Validation and Acceptance
180
-
181
- The feature is complete when:
182
-
183
- 1. `pnpm test` passes with all existing tests plus new tests for extract, tool-result-handler, and extended smoke tests.
184
- 2. `pnpm lint` passes with no type errors.
185
- 3. A tool result message containing `"Call 555-123-4567 or email john@example.com"` is passed to the `tool_result_persist` handler and the returned message contains `"Call [PHONE_1] or email [EMAIL_1]"` (with token strategy) and the original values do not appear.
186
- 4. A tool result message containing no PII returns `void` (no modification).
187
- 5. An allowlisted value (e.g., `noreply@example.com`) is not redacted even when detected.
188
- 6. When `auditEnabled: true`, the logger receives an audit entry with `source: "tool_result"`, entity count, and labels but no raw PII values.
189
-
190
- ## Idempotence and Recovery
191
-
192
- All changes are additive — new files (`src/extract.ts`, `src/tool-result-handler.ts`) and new tests. No existing files are modified except `src/index.ts` (adding a hook registration) and `tests/plugin-smoke.test.ts` (adding test cases).
193
-
194
- If a step fails partway, delete the partially created files and restart from the milestone. No database migrations, no state files, no destructive operations.
195
-
196
- Running `pnpm test` at any point is safe and idempotent.
197
-
198
- ## Artifacts and Notes
199
-
200
- Full test suite output:
201
-
202
- ✓ tests/extract.test.ts (27 tests) 4ms
203
- ✓ tests/config.test.ts (6 tests) 4ms
204
- ✓ tests/redactor.test.ts (21 tests) 6ms
205
- ✓ tests/regex.test.ts (39 tests) 11ms
206
- ✓ tests/tool-result-handler.test.ts (21 tests) 10ms
207
- ✓ tests/gliner.test.ts (12 tests) 10ms
208
- ✓ tests/plugin-smoke.test.ts (8 tests) 9ms
209
- ✓ tests/scanner.test.ts (15 tests) 13ms
210
-
211
- Test Files 8 passed (8)
212
- Tests 149 passed (149)
213
-
214
- Type check: `npx tsc --noEmit` — clean, no errors.
215
-
216
- ## Interfaces and Dependencies
217
-
218
- **New module `src/extract.ts`:**
219
-
220
- export function extractText(message: unknown): string
221
- export function replaceText(message: unknown, redactedText: string): unknown
222
-
223
- **New module `src/tool-result-handler.ts`:**
224
-
225
- import { RegexEngine } from "./engines/regex.js";
226
- import { FogClawConfig } from "./types.js";
227
-
228
- interface Logger {
229
- info(msg: string): void;
230
- warn(msg: string): void;
231
- }
232
-
233
- interface ToolResultPersistEvent {
234
- toolName?: string;
235
- toolCallId?: string;
236
- message: unknown;
237
- isSynthetic?: boolean;
238
- }
239
-
240
- interface ToolResultPersistContext {
241
- agentId?: string;
242
- sessionKey?: string;
243
- toolName?: string;
244
- toolCallId?: string;
245
- }
246
-
247
- export function createToolResultHandler(
248
- config: FogClawConfig,
249
- regexEngine: RegexEngine,
250
- logger?: Logger,
251
- ): (event: ToolResultPersistEvent, ctx: ToolResultPersistContext) =>
252
- { message: unknown } | void
253
-
254
- **Modified `src/index.ts`:**
255
-
256
- Inside the `register(api)` function, after the existing `before_agent_start` registration, add:
257
-
258
- const toolResultHandler = createToolResultHandler(config, scanner.regexEngine, api.logger);
259
- api.on("tool_result_persist", toolResultHandler);
260
-
261
- This requires exposing `regexEngine` from the Scanner class (currently private). Either make it a public property or instantiate a separate RegexEngine in `register()`.
262
-
263
- **No new dependencies.** All imports are from existing FogClaw modules or Node built-ins.
264
-
265
- ## Pull Request
266
-
267
- Populated by `he-github`.
268
-
269
- - pr:
270
- - branch:
271
- - commit:
272
- - ci:
273
-
274
- ## Review Findings
275
-
276
- Populated by `he-review`.
277
-
278
- ## Verify/Release Decision
279
-
280
- Populated by `he-verify-release`.
281
-
282
- - decision:
283
- - date:
284
- - open findings by priority (if any):
285
- - evidence:
286
- - rollback:
287
- - post-release checks:
288
- - owner:
289
-
290
- ## Revision Notes
291
-
292
- - 2026-02-17T00:00:00Z: Initialized plan from template. Reason: establish PLANS-compliant execution baseline for tool result PII scanning.
293
- - 2026-02-17T17:30:00Z: All milestones completed. Updated Progress, Surprises & Discoveries, Outcomes & Retrospective, and Artifacts sections with implementation evidence.
@@ -1,42 +0,0 @@
1
- # Tech Debt Tracker
2
-
3
- General-purpose deferred-work queue. Review findings, cleanup tasks, improvement ideas — anything we want to address later but shouldn't block now. Any skill can append to this file.
4
-
5
- Treat this file as append-and-update: do not delete historical rows unless duplicated by mistake. When status changes, update both the index table row and the detail entry.
6
-
7
- ## Status Semantics
8
-
9
- - `new`: captured, not yet scheduled.
10
- - `queued`: prioritized for a future slug.
11
- - `in_progress`: being addressed in an active plan.
12
- - `resolved`: fixed, evidence linked.
13
- - `wont_fix`: consciously accepted with documented rationale.
14
-
15
- ## Index
16
-
17
- | ID | Date | Priority | Source | Status | Summary |
18
- |---|---|---|---|---|---|
19
- | TD-2026-02-17-01 | 2026-02-17 | high | 2026-02-17-feat-submit-fogclaw-to-openclaw-plan | resolved | Define and document the canonical upstream PR path for external plugin submissions from non-fork plugin repos.
20
- | TD-2026-02-17-02 | 2026-02-17 | medium | 2026-02-17-feat-submit-fogclaw-to-openclaw-plan | new | Track package scope/publish readiness (`@openclaw/fogclaw` visibility) separately from PR review progress.
21
-
22
- ## Detail Entries
23
-
24
- <!-- Append new entries below this line. -->
25
-
26
- - **TD-2026-02-17-01**
27
- - **Source:** initiative `docs/plans/active/2026-02-17-feat-submit-fogclaw-to-openclaw-plan.md`
28
- - **Status:** resolved
29
- - **Priority:** high
30
- - **Owner:** sidmohan / OpenClaw intake coordination
31
- - **Action:** Add and maintain the submission-runbook path so all future external plugin submissions use the same fork-first + forked PR pattern.
32
- - **Evidence/Reference:** Created `DataFog/openclaw` fork and moved active PR to `openclaw/openclaw` PR #18791 from `DataFog:openclaw-upstream-submission`.
33
- - **Rollback:** none; process doc update is now in place as docs-only.
34
-
35
- - **TD-2026-02-17-02**
36
- - **Source:** initiative `docs/plans/active/2026-02-17-feat-submit-fogclaw-to-openclaw-plan.md`
37
- - **Status:** new
38
- - **Priority:** medium
39
- - **Owner:** sidmohan / OpenClaw release coordinators
40
- - **Action:** Add release gate that confirms `npm view @openclaw/<plugin>` visibility before merge is finalized.
41
- - **Evidence/Reference:** `npm view @openclaw/fogclaw version` currently returns E404 from this environment.
42
- - **Rollback:** if scope changes, update entry to `resolved` with release evidence and PR link.
@@ -1,101 +0,0 @@
1
- ---
2
- summary: "FogClaw plugin for agent message redaction and PII scanning"
3
- read_when:
4
- - You want optional built-in privacy tooling in OpenClaw
5
- - You need configurable redaction, blocking, or warning for sensitive content
6
- - You are setting up a custom entity scanner in your agent workflow
7
- title: "FogClaw Plugin"
8
- ---
9
-
10
- # FogClaw (plugin)
11
-
12
- FogClaw is an OpenClaw plugin that protects agent workflows by detecting and handling sensitive data before or during tool execution.
13
-
14
- It provides both proactive guardrail behavior (via the `before_agent_start` hook) and explicit tools:
15
-
16
- - GLiNER ONNX artifacts are provisioned automatically on first run (no manual `download` step required).
17
- - If the model cannot be downloaded (offline or restricted network), FogClaw continues in regex-only mode.
18
-
19
- - `fogclaw_scan`: scans text for PII and custom entities.
20
- - `fogclaw_redact`: scans and redacts sensitive matches.
21
-
22
- ## Install
23
-
24
- ```bash
25
- openclaw plugins install @datafog/fogclaw
26
- ```
27
-
28
- After install, restart the Gateway and enable/configure `plugins.entries.fogclaw`.
29
-
30
- A moderately technical user can also manage this in the OpenClaw **Control UI** (`openclaw dashboard`) under Config; the plugin schema now exposes labeled fields for `guardrail_mode`, `redactStrategy`, and related policy options in the UI form.
31
-
32
- ## Plugin entry
33
-
34
- The package exports the plugin manifest and entry as:
35
-
36
- - plugin id: `fogclaw`
37
- - package name: `@datafog/fogclaw`
38
- - extension entry: `./dist/index.js`
39
-
40
- ## What it scans
41
-
42
- - Structured PII via regex (for example emails, phone numbers, SSNs, credit cards)
43
- - Custom named-entity labels via GLiNER zero-shot detection
44
-
45
- You can also define custom entity labels and per-entity actions in config (for example `redact`, `block`, or `warn`).
46
-
47
- ## Behavior at a glance
48
-
49
- - Runs as a plugin loaded by the standard OpenClaw plugin pipeline.
50
- - Supports local-only and hosted environments; works from OpenClaw extensions path.
51
- - Fails safely to regex-only mode if optional GLiNER model initialization is unavailable.
52
-
53
- ## Configuration reference
54
-
55
- Set plugin config under `plugins.entries.fogclaw.config`:
56
-
57
- ```json5
58
- {
59
- plugins: {
60
- entries: {
61
- fogclaw: {
62
- enabled: true,
63
- config: {
64
- enabled: true,
65
- guardrail_mode: "redact",
66
- redactStrategy: "token",
67
- model: "onnx-community/gliner_large-v2.1",
68
- confidence_threshold: 0.5,
69
- custom_entities: ["project codename", "competitor name"],
70
- entityActions: {
71
- EMAIL: "redact",
72
- PHONE: "redact",
73
- SSN: "block",
74
- CREDIT_CARD: "block",
75
- PERSON: "warn",
76
- },
77
- },
78
- },
79
- },
80
- },
81
- }
82
- ```
83
-
84
- ## Use in the OpenClaw tool policy
85
-
86
- When enabled, the plugin registers the `before_agent_start` hook and two tools:
87
-
88
- - `fogclaw_scan`
89
- - `fogclaw_redact`
90
-
91
- These tools accept a required `text` field and optional strategy / custom label overrides.
92
-
93
- For install and reproducible package metadata evidence, use the package's `openclaw.extensions` field:
94
-
95
- ```json
96
- {
97
- "openclaw": {
98
- "extensions": ["./dist/index.js"]
99
- }
100
- }
101
- ```
@@ -1,30 +0,0 @@
1
- ---
2
- title: "Address Review Findings"
3
- use_when: "You have review findings in an active plan and need a consistent process to fix, re-run review, and document what changed."
4
- called_from:
5
- - he-review
6
- - he-implement
7
- ---
8
-
9
- # Address Review Findings
10
-
11
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
12
-
13
- ## Workflow
14
-
15
- 1. Triage findings by priority.
16
- 2. For each `critical`/`high`, do one of:
17
- - fix it (preferred), or
18
- - escalate per `he-review` SKILL.md § Escalation if behavior is ambiguous or risk is unclear.
19
- 3. For `medium`/`low`, either:
20
- - fix it, or
21
- - accept it explicitly in the plan with rationale and follow-up link.
22
- 4. Update evidence:
23
- - rerun the most relevant tests
24
- - update `Artifacts and Notes` with new proof
25
- 5. Update `Progress`, `Decision Log`, and `Revision Notes` in the plan to reflect what changed and why.
26
- 6. Re-run `he-review` if the change materially altered behavior or implementation.
27
-
28
- ## Re-entry Rules
29
-
30
- See `he-review` SKILL.md § Re-entry Rules for the canonical gates (design-level issues and material behavior changes).
@@ -1,46 +0,0 @@
1
- ---
2
- title: "Remediate CI Failures"
3
- use_when: "A verify/release gate fails due to build/test/lint failures locally or in CI; you need a consistent triage and stop/escalate policy."
4
- called_from:
5
- - he-verify-release
6
- - he-implement
7
- ---
8
-
9
- # Remediate CI Failures
10
-
11
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
12
-
13
- Treat CI failures as signal. The goal is not to make CI green by any means; it is to restore correctness with minimal, root-cause fixes.
14
-
15
- ## Triage Order
16
-
17
- 1. Confirm you are testing the right thing (branch, commit, env).
18
- 2. Identify failure class:
19
- - deterministic test failure
20
- - flaky test
21
- - lint/format/typecheck
22
- - build/tooling regression
23
- 3. Reduce to the smallest reproducer command.
24
-
25
- ## Deterministic Failures
26
-
27
- - Add or adjust a real unit/e2e test when the failure indicates a missing assertion.
28
- - Fix the underlying behavior; avoid "just loosen the test" unless the test is truly wrong.
29
-
30
- ## Flaky Failures
31
-
32
- - If you can reproduce locally, fix like deterministic.
33
- - If you cannot reproduce:
34
- - mark as `judgment required` and escalate with evidence per the calling skill's § Escalation
35
- - do not disable tests silently
36
-
37
- ## Tooling Failures
38
-
39
- - Keep changes minimal and reversible.
40
- - Prefer pinning/fixing the tool invocation over broad refactors.
41
-
42
- ## Required Evidence
43
-
44
- - Command used to reproduce
45
- - Short failure output excerpt
46
- - Command/output showing the fix
@@ -1,34 +0,0 @@
1
- ---
2
- title: "Code Review"
3
- use_when: "Running he-review to perform structured review fanout, write Review Findings into the active plan, and decide whether the work can proceed to verify/release."
4
- called_from:
5
- - he-review
6
- ---
7
-
8
- # Code Review
9
-
10
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
11
-
12
- The skill `he-review` enforces stable gates (fanout, findings format, and priority blocking). This document carries the details that change per project. Inputs: active plan (`docs/plans/active/<slug>-plan.md` with `## Review Findings`) and current branch diff/test evidence.
13
-
14
- ## Output
15
-
16
- Populate `## Review Findings` with:
17
-
18
- - a prioritized list of findings (see `docs/runbooks/review-findings.md`)
19
- - accepted medium/low items (explicitly called out)
20
- - any required re-entry decision (`he-implement` vs `he-plan`)
21
-
22
- ## What Review Must Cover (Customize Per Repo)
23
-
24
- Keep this list short and concrete:
25
-
26
- - correctness and edge cases in the changed area
27
- - tests: coverage of new behavior and regression prevention
28
- - user-visible behavior (if applicable) with evidence
29
- - security/data boundaries (if applicable)
30
- - performance or reliability impact (if applicable)
31
-
32
- ## Escalation
33
-
34
- If review requires judgment (risk unclear, expected behavior ambiguous, flaky failures), stop and escalate per `he-review` SKILL.md § Escalation.
@@ -1,28 +0,0 @@
1
- ---
2
- title: "Merge Change"
3
- use_when: "You have a GO decision and need the minimum merge gate (checks/approvals/evidence) before merging to the main branch."
4
- called_from:
5
- - he-verify-release
6
- ---
7
-
8
- # Merge Change
9
-
10
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
11
-
12
- This runbook captures the repo-specific merge gate. Keep it short and make it objective where possible.
13
-
14
- ## Preconditions
15
-
16
- See `he-github` SKILL.md § Merge for the canonical merge gate. Add repo-specific preconditions below.
17
-
18
- ## Merge Checklist (Customize Per Repo)
19
-
20
- - Required approvals obtained
21
- - Required checks passing
22
- - Versioning/release notes updated (if applicable)
23
- - Post-merge verification steps queued (see `docs/runbooks/verify-release.md`)
24
-
25
- ## Post-Merge
26
-
27
- - Run the post-release checks documented in the plan
28
- - If any regression is found, open a follow-up and record it in learnings
@@ -1,45 +0,0 @@
1
- ---
2
- title: "Pull Request"
3
- use_when: "You need to open or update a PR that links the initiative plan and evidence, and you want a consistent PR hygiene/checks workflow."
4
- called_from:
5
- - he-github
6
- - he-implement
7
- - he-review
8
- ---
9
-
10
- # Pull Request
11
-
12
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
13
-
14
- This runbook describes repo-specific PR conventions (title/body conventions, labels, reviewers, and required checks).
15
-
16
- ## Preflight
17
-
18
- - `git status --short --branch`
19
- - `git diff`
20
- - `gh auth status`
21
-
22
- ## Create Or Update PR (Customize Per Repo)
23
-
24
- Recommended `gh` flow:
25
-
26
- - Push:
27
- - `git push -u origin HEAD`
28
- - Create:
29
- - `gh pr create --fill`
30
- - Update:
31
- - `gh pr edit --body-file <path>`
32
-
33
- ## Required Links In PR Description
34
-
35
- - Spec: `docs/specs/<slug>-spec.md`
36
- - Plan: `docs/plans/active/<slug>-plan.md`
37
- - Evidence (if any): `docs/artifacts/<slug>/...`
38
-
39
- ## Checks
40
-
41
- - View checks:
42
- - `gh pr checks`
43
- - View a failing run:
44
- - `gh run view --log-failed`
45
-
@@ -1,43 +0,0 @@
1
- ---
2
- title: "Record Evidence"
3
- use_when: "You need screenshots or short recordings as proof of failure and proof of resolution, especially for UI or behavior changes."
4
- called_from:
5
- - he-video
6
- - he-verify-release
7
- - he-implement
8
- ---
9
-
10
- # Record Evidence
11
-
12
- This runbook is repo-specific and **additive only**. It must not waive or override any gates enforced by skills.
13
-
14
- Evidence should be easy to review, easy to find, and tied to an artifact (plan/PR) so it does not get lost.
15
-
16
- ## What To Capture
17
-
18
- - Failure evidence: what is broken, with a minimal reproduction
19
- - Resolution evidence: the same reproduction after the fix
20
- - Any relevant logs or error output (short)
21
-
22
- ## Where To Put It
23
-
24
- - Link evidence from:
25
- - `docs/plans/active/<slug>-plan.md` under `Artifacts and Notes` and `Verify/Release Decision`
26
- - the PR description (if one exists)
27
-
28
- ## Naming Convention
29
-
30
- Use predictable names so evidence is searchable:
31
-
32
- - `<slug>-failure.<ext>`
33
- - `<slug>-resolution.<ext>`
34
-
35
- If multiple clips exist:
36
-
37
- - `<slug>-failure-1.<ext>`, `<slug>-resolution-1.<ext>`
38
-
39
- ## Minimum Bar
40
-
41
- - If you claim a bug exists, there is at least one artifact showing it.
42
- - If you claim it is fixed, there is at least one artifact showing the fix under the same scenario.
43
- - Prefer short clips (10-60s) over long walkthroughs.