feed-the-machine 1.7.11 → 1.7.13
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.
- package/bin/playbook_engine/__pycache__/__init__.cpython-314.pyc +0 -0
- package/bin/playbook_engine/__pycache__/manager.cpython-314.pyc +0 -0
- package/bin/playbook_engine/__pycache__/models.cpython-314.pyc +0 -0
- package/ftm-mind/references/decide-act-protocol.md +28 -0
- package/ftm-mind/references/orient-protocol.md +41 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -107,6 +107,34 @@ Act is clean, decisive execution — but execution of **approved** work only.
|
|
|
107
107
|
|
|
108
108
|
**This applies to ALL execution methods** — Bash commands, MCP calls, Python scripts, curl, direct API calls. The plan-gate hook catches Edit/Write/MCP, but Bash API calls bypass it. This checkpoint is the only thing that catches those. Do not skip it.
|
|
109
109
|
|
|
110
|
+
### Compare Before You Loop (MANDATORY for external system operations)
|
|
111
|
+
|
|
112
|
+
When working with external systems (Freshservice, Okta, Jira, Trelica, any API), **never trial-and-error your way to a solution.** Instead:
|
|
113
|
+
|
|
114
|
+
**Step 1: Find a working reference.**
|
|
115
|
+
Before making any changes, find an existing resource that already works the way you want the target to work. Examples:
|
|
116
|
+
- Updating a catalog item's roles table? GET the working one (HR Acuity #630) AND the broken one. Diff them field by field.
|
|
117
|
+
- Fixing an Okta group mapping? GET a group that works correctly and compare its config to the broken one.
|
|
118
|
+
- Updating a Jira automation? Read a working rule's config before touching the broken one.
|
|
119
|
+
|
|
120
|
+
**Step 2: Diff, don't guess.**
|
|
121
|
+
Compare the working reference against the target. The fix is almost always a small, specific difference — a missing field option, a different encoding, a wrong position value. Find that diff. Don't hypothesize about what might be wrong.
|
|
122
|
+
|
|
123
|
+
**Step 3: Make targeted changes.**
|
|
124
|
+
Change ONLY what the diff revealed. One field at a time if needed. Verify after each change.
|
|
125
|
+
|
|
126
|
+
**The trial-and-error trap**: When an API call fails, your instinct is to try a different endpoint, different payload, different method. After 3 failed attempts you're in a loop — guessing at combinations. STOP. Go back to Step 1. The answer is in the working reference, not in your next guess.
|
|
127
|
+
|
|
128
|
+
**Red flags that you're in a loop:**
|
|
129
|
+
- You've made 3+ API calls to the same system without a success
|
|
130
|
+
- You're trying different URL path formats (underscore vs hyphen, internal ID vs display ID)
|
|
131
|
+
- You're adding/removing fields from the payload hoping one combination works
|
|
132
|
+
- You're reading API docs or source code to figure out the endpoint (the playbook should have this)
|
|
133
|
+
|
|
134
|
+
**When you detect a loop:** STOP executing. Tell the user: "I've tried N approaches and none worked. Let me compare against a working reference before continuing." Then do Step 1.
|
|
135
|
+
|
|
136
|
+
**The April 2026 lesson**: A one-field-option diff (`requester_can_edit: "true"`) was the entire fix for the Freshservice roles table not rendering. It took 15+ API calls, accidental field duplication, and destructive deletion of two catalog items to discover what a 30-second field-by-field comparison against the working HR Acuity item would have revealed immediately.
|
|
137
|
+
|
|
110
138
|
### 1. Direct action
|
|
111
139
|
|
|
112
140
|
For micro tasks:
|
|
@@ -290,6 +290,47 @@ Skip this step if:
|
|
|
290
290
|
- The session context already contains recently loaded task state (within 15 minutes)
|
|
291
291
|
- The request is purely local with no operational relevance (e.g., pure code edits)
|
|
292
292
|
|
|
293
|
+
## Playbook Lookup (MANDATORY before any external system operation)
|
|
294
|
+
|
|
295
|
+
**Before executing any operation on an external system (Freshservice, Okta, Jira, Trelica, S3, etc.), check for an existing playbook.** This is not optional. Playbooks encode hard-won lessons — API quirks, encoding requirements, field types that can't be updated, correct endpoint paths. Skipping this step means repeating every mistake the playbook was written to prevent.
|
|
296
|
+
|
|
297
|
+
**Step 1: Check brain.py playbooks.**
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
python3 ~/.claude/skills/ftm/bin/brain.py --playbook-match "[describe the operation]" --playbook-match-source freshservice
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
If a match returns with confidence > 0.2, read the full playbook before proceeding.
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
python3 ~/.claude/skills/ftm/bin/brain.py --playbook-list
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Also list all playbooks and scan names — sometimes the match query misses a relevant one.
|
|
310
|
+
|
|
311
|
+
**Step 2: Check repo-local playbooks.**
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
ls docs/playbooks/ 2>/dev/null
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
If the current repo has a `docs/playbooks/` directory, scan it for files matching the target system. Read any relevant playbook before writing a single line of code.
|
|
318
|
+
|
|
319
|
+
**Step 3: Check blackboard experiences.**
|
|
320
|
+
|
|
321
|
+
Read `experiences/index.json` and filter by tags matching the target system. Load matching experience files and check for `code_patterns` and `api_gotchas` fields.
|
|
322
|
+
|
|
323
|
+
**What playbooks prevent:**
|
|
324
|
+
- Using raw HTML when Freshservice requires entity-encoded HTML (`html.escape()`)
|
|
325
|
+
- Trying to PUT on `service_catalog/items/{internal_id}` when the correct path is `service-catalog/items/{display_id}`
|
|
326
|
+
- Including `custom_lookup_bigint` fields in API updates (they're admin-UI-only)
|
|
327
|
+
- Deleting and recreating resources when an in-place update works
|
|
328
|
+
- Repeating 10+ failed API calls to discover what the playbook already documents
|
|
329
|
+
|
|
330
|
+
**The April 2026 Braintrust incident**: A playbook existed (`docs/playbooks/freshservice-service-catalog-item.md`), the blackboard had the lesson ("FS rich text tables require html.escape()"), and a brain.py playbook (`fs-hide-catalog-el`) was available. None were consulted. The result: 15+ failed API attempts, accidental creation of duplicate fields, then destructive deletion of two catalog items breaking S3 workflow automation.
|
|
331
|
+
|
|
332
|
+
**If no playbook exists** and the operation succeeds after trial-and-error, the auto-playbook hook should trigger. If it doesn't, proactively invoke ftm-capture to save the working pattern.
|
|
333
|
+
|
|
293
334
|
## Orient Synthesis
|
|
294
335
|
|
|
295
336
|
Before leaving Orient, silently synthesize all signals into one internal picture:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feed-the-machine",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.13",
|
|
4
4
|
"description": "A brain upgrade for Claude Code — 26 skills that teach it how to think before acting, remember across conversations, debug like a war room, run plans on autopilot with agent teams, and get second opinions from GPT & Gemini. Plus 15 hooks that automate the boring stuff.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "kkudumu",
|