Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
0bab548
Update installer overview document with all recent changes
Mar 14, 2026
7626124
Add Superpowers structured workflow skills for sub-agents
Mar 14, 2026
2b76b7d
Fix browser approval button and add configurable duration
Mar 14, 2026
0abdd33
Fix browser approval button: use imBack instead of messageBack
Mar 14, 2026
7a2a763
Address all document review comments + installer improvements
Mar 15, 2026
583c198
Move Teams fully to Core installer
Mar 15, 2026
3470092
Move deputy agent system fully to Core
Mar 15, 2026
d92456c
Update document: deputies + Teams fully in Core
Mar 15, 2026
5e9dd70
Add security hardening to installer + Section 9 to document
Mar 15, 2026
43298a6
Make Bates functional without M365 + generic SOUL.md template
Mar 15, 2026
3ae5ef8
Clarify Teams works without M365 sign-in (multi-tenant bot in Core)
Mar 15, 2026
24ef986
Add two-machine diagram to README + OpenClaw attribution everywhere
Mar 15, 2026
5abb00c
Show OpenClaw MIT license before Bates disclaimer in installer
Mar 15, 2026
53371cd
Add OpenClaw security notice to installer pre-page
Mar 15, 2026
ce19fae
Add full Apache 2.0 license text to Bates disclaimer page
Mar 15, 2026
f9bc3b1
Add prominent Robert Koller credit to Bates disclaimer header
Mar 15, 2026
96024f9
Fix splash screen TForm for Inno Setup 6 compatibility + compile
Mar 15, 2026
9f44e97
Fix all Codex audit findings (CRITICAL + HIGH + MEDIUM + LOW)
Mar 15, 2026
045133e
Add publisher metadata to installer exe
Mar 15, 2026
f01d6d8
Fix two-machine diagram display in installer
Mar 15, 2026
ffdfbef
Add cancel points and confirmation before system changes
Mar 15, 2026
e45398f
Move role selection into Inno Setup wizard page
Mar 15, 2026
3c24ec2
Fix all Codex second audit findings + page order + wizard images
Mar 15, 2026
bb18140
Update README with current agent roster and fix stale references
Mar 15, 2026
ae3f3d0
Fix remaining hardcoded emails in subagent-policy.md
Mar 15, 2026
29f0a5b
Fix all remaining Codex third audit findings
Mar 15, 2026
62f6626
Add install logging, progress tracking, API validation, upgrade detec…
Mar 15, 2026
4735d50
Add Tauri GUI installer (v3) — scaffolded and frontend built
Mar 15, 2026
f02806a
Add M365 tools and Mixpost gateway plugins
Mar 15, 2026
1ab7340
Add Word, Excel, and PowerPoint delegation skill files
Mar 15, 2026
ff8758a
Add generic reminder subsystem
Mar 16, 2026
25051b0
Make reminders platform-aware and add to installer
Mar 16, 2026
71a04f8
Add calendar write tools, find meeting times, and user lookup
Mar 16, 2026
d00e3d3
Add draft_email tool — creates drafts in Outlook without sending
Mar 16, 2026
e163277
Update email and calendar instructions to use native tools
Mar 16, 2026
59635fa
Support multi-account email drafts (vernot + fdesk)
Mar 16, 2026
bccd677
Fix external links + wire up install backend
Mar 16, 2026
9bdca25
Fix H4 (broken refs) and M3 (README accuracy) - final Codex items
Mar 16, 2026
2c23d87
Add prompt injection guard plugin and defense rules
Mar 17, 2026
57cf7b8
Genericize repo for public demo + add missing scripts, refs, rules, s…
Mar 17, 2026
9c4eb10
Fix installer gaps: deploy refs, Python scripts, m365-tools, mixpost
Mar 17, 2026
6c3d7e7
Add arXiv research integration via alphaXiv MCP server
Mar 17, 2026
9265c88
Add video generation (Sora + Veo) and Nano Banana image gen with cost…
Mar 17, 2026
ee66c7a
Add stop-slop writing skill (removes AI tells from prose)
Mar 18, 2026
e83c6dc
Add stop-slop writing rules to delegation prompt template
Mar 18, 2026
bc13d41
Wire up Tauri installer v3: OAuth, bundling, non-interactive mode
Mar 18, 2026
4b8525e
Fix all Codex audit findings: auth, verify, obfuscation, enhance staging
Mar 19, 2026
13dca97
Harden installer: build freshness, secret cleanup, WSL probe, auth al…
Mar 19, 2026
eff25a1
Fix CRLF in core-remote-access.sh, remove unused end_tag variable
Mar 19, 2026
2f2d0df
Clean up shellcheck warnings: remove unused vars, fix SC2155
Mar 19, 2026
60e6d0d
Add single-machine VM setup option to README + build info
Mar 19, 2026
d5edafa
README: Add quick single-machine setup as primary option, two-machine…
Mar 19, 2026
dbbbb73
Add 16GB RAM recommendation for single-machine setup
Mar 19, 2026
247f268
Add Control UI patch: Mission Control + Voice sidebar links
Mar 19, 2026
e20971c
Wire up PostHog analytics with real project key
Mar 19, 2026
8668ce7
Add privacy/analytics transparency note to README
Mar 19, 2026
09a8535
Fix false RAM check failure on 8GB machines
Mar 20, 2026
53d92b3
Fix 15 installer issues blocking fresh installs
Mar 20, 2026
8e81ff2
Replace piped-stdin WSL commands with temp-file approach
Mar 20, 2026
eb40187
Fix systemd setup: use wsl -u root, ensure passwordless sudo, stop ws…
Mar 20, 2026
9759c7c
Add wsl --update for Store version, auto-upgrade Ubuntu 20.04, better…
Mar 20, 2026
4c7c658
Wait for WSL upgrade to finish, fix stderr error handling
Mar 20, 2026
aef7d3a
Fix .wslconfig: remove invalid [boot] systemd key, add cleanup, fix s…
Mar 20, 2026
7c7b4a3
Move wslconfig cleanup before all wsl commands, change ErrorActionPre…
Mar 21, 2026
eac9cc1
Fix $PID read-only variable, skip missing patch files, fix crontab pi…
Mar 21, 2026
7f2c137
Fix M365 device code grant type URN typo (grants -> grant-type)
Mar 21, 2026
201c235
Fix device code not displaying: bypass cmd /c buffering for interacti…
Mar 21, 2026
24b7d6d
Move analytics consent to License page, fix progress bar, highlight d…
Mar 21, 2026
19b7584
Add openclaw doctor --fix, remove invalid tokenEnvVar, fix device cod…
Mar 21, 2026
209303f
Fix assistant email not captured, fix legacy gateway.bind and streamM…
Mar 21, 2026
32cb33e
Security audit fixes: remove hardcoded secrets and personal infrastru…
Mar 21, 2026
0bcee54
Installer v1 fixes: plugins, dashboard, auth, mobile UX
Mar 21, 2026
7fe0afa
Switch both auth steps to PKCE, fix dashboard mobile + chat UX
Mar 21, 2026
9fd4fa1
Fix M365 PKCE: add scope to token exchange, refactor shared helper
Mar 21, 2026
4b9ab38
Fix URL quoting for cmd.exe — & was truncating OAuth URLs
Mar 21, 2026
12680eb
Use open::that() for OAuth URLs — default browser, no cmd.exe mangling
Mar 21, 2026
5d3c781
Open OAuth in private browser window (Edge InPrivate / Chrome Incognito)
Mar 21, 2026
c4a2427
Fix black screen: keep entry page rendered with overlay during auth
Mar 21, 2026
fac6e9e
Fix black screen: no overlay/phase switch, just button spinner like A…
Mar 21, 2026
87fef62
Remove slow feature probing from M365 auth — fixes WebView2 black screen
Mar 21, 2026
259b943
Use open::that() for all OAuth — fixes WebView2 black screen
Mar 22, 2026
82dda25
Separate Sign In from Continue — no page transition during OAuth
Mar 22, 2026
0a0edee
Fix verify: restart gateway for new token, hide empty projects,
Mar 22, 2026
b22adf1
Write gateway token into openclaw.json directly — fixes WebSocket auth
Mar 22, 2026
c351eb4
Dashboard reads gateway token from config file, not just env var
Mar 22, 2026
dc12382
Skip Ed25519 device auth in dashboard — use token-only WebSocket auth
Mar 22, 2026
0ea97e1
Send empty device object instead of null — server requires object type
Mar 22, 2026
785d69d
Restore Ed25519 device auth (required by protocol v3), skip stale sto…
Mar 22, 2026
9855634
Set OPENCLAW_GATEWAY_TOKEN env var from config — fixes WebSocket auth…
Mar 22, 2026
fbdd9ed
Fix WebSocket auth: use --token-file in systemd service
Mar 22, 2026
6036445
Revert --token-file (crashes gateway), use systemd drop-in + restart
Mar 22, 2026
8d65427
Force noble Ed25519 signing to match noble key generation
Mar 22, 2026
d8f5f1a
Fix Ed25519 key/sign mismatch: use same implementation for both
Mar 22, 2026
0542dd5
Retry WebSocket auth once after clearing stale device identity
Mar 22, 2026
c799a9c
Store full PKCS8 private key for Ed25519 signing (no seed extraction)
Mar 22, 2026
eec31e7
Fix template: dmPolicy open + allowFrom *, model matches auth method
Mar 22, 2026
d4501ed
Replace all hardcoded 'Bates' in dashboard with dynamic assistant name
Mar 22, 2026
0d7a1dc
Add Teams setup page with Tailscale auth + server-side credential fetch
Mar 22, 2026
e602f19
Add license key validation to Teams credential fetch
Mar 22, 2026
5f5414e
Auto-register license key via email in Teams setup
Mar 22, 2026
00295b1
Prep installer patches for upcoming OpenClaw v2026.3.14+ release
Mar 23, 2026
752cc25
Deploy OpenClaw v2026.3.22 — handle major structural changes
Mar 23, 2026
aa95639
Fix Control UI sidebar: replace docs link with Mission Control + Voice
Mar 23, 2026
0f2751f
Add MSTeams SDK pairing export fix to reapply-patches.sh
Mar 23, 2026
fea8e98
Fix all 5 missing MSTeams SDK exports in reapply-patches.sh
Mar 23, 2026
2ab32cc
Fix patches for v2026.3.23: Control UI regex, ESM export constraints
Mar 24, 2026
7be88fc
Sync installer, plugins, and templates for v2026.3.23
Mar 24, 2026
e595dd9
Fix m365-safety: remove nonexistent socket dependency
Mar 24, 2026
7a991b4
Add Tailscale setup page to installer GUI
Mar 24, 2026
62cf0e1
Add describeMessageTool patch for @openclaw/msteams (section 9)
Mar 25, 2026
692b493
Unify gateway watchdog: HTTP health + msteams + stuck sessions
Mar 25, 2026
a734b2b
Fix delegation enforcer blocking /dev/null writes
Mar 25, 2026
7297e08
Add Planner access reference for agents
Mar 25, 2026
56ab3a5
Add Enhanced Features panel to Mission Control dashboard
Mar 26, 2026
dcba8ff
Add graph-api-rk.sh for rk@vernot.com OneDrive access
Mar 26, 2026
7b811e4
Rename graph-api-rk.sh to graph-api-user.sh (generic owner access)
Mar 26, 2026
2af6734
Multi-account Graph API: --account flag for all M365 accounts
Mar 26, 2026
c9ebcd6
Fix Enhanced panel: detection logic + setup buttons
Mar 26, 2026
02e9297
Fix fetchApi to support POST requests (method, body, headers)
Mar 26, 2026
7499d8c
Persist bates-enhance integrations to ~/.openclaw/enhance/
Mar 26, 2026
6cdea61
Enhanced panel: show setup instructions instead of running scripts
Mar 26, 2026
457b57c
Enhanced panel: setup modals with credential input forms
Mar 26, 2026
cb31dc5
Fix video detection, split transcription as separate feature
Mar 26, 2026
8e37982
Add WSL2 auto-start for headless reboot survival
Mar 30, 2026
76a11f8
Use masked console prompt for auto-logon password instead of GUI dialog
Mar 30, 2026
c770e65
Add 10s delay to auto-lock task so desktop loads before locking
Mar 30, 2026
56f6690
Fix auto-lock bypass: disable AutoAdminLogon after locking
Mar 30, 2026
eb89394
Switch auto-logon from LSA to DPAPI with registry toggle
Mar 30, 2026
58d201e
Add configurable relay host to Chrome extension for remote gateway
Mar 30, 2026
592cb57
Pass relay host to validation messages in Chrome extension
Mar 30, 2026
4e8abc1
Fix Chrome extension auth: use Bearer token instead of HMAC relay token
Mar 31, 2026
86cd299
Fix channel-bridge: add webhookUrl to config schema + update configSc…
Mar 31, 2026
165d728
Add thread-aware delivery for sub-agent announces and cron jobs
Mar 31, 2026
f10c82b
Fix Graph subscription limit: fallback to bot app credentials
Mar 31, 2026
89e3475
Sync live system files to repo: bat scripts, browser relay proxy service
Mar 31, 2026
6da152b
Revert Chrome extension changes — extension deprecated, using CDP dir…
Mar 31, 2026
9638f8e
Remove Chrome extension install from installer, use CDP instead
Mar 31, 2026
b59e439
Add Certum code signing to Tauri build
Mar 31, 2026
8f08e5a
Add Chrome CDP browser control to installer
Mar 31, 2026
46a5377
Remove Chrome CDP auto-setup from installer
Mar 31, 2026
2c3f040
Add Bates Browser Control extension + bridge
Mar 31, 2026
9df50ec
Add browser control extension + bridge to installer
Mar 31, 2026
a49dd93
Split browser control: bridge on server, extension on client
Mar 31, 2026
50adeb0
Fix transcription skill: sub-agent now reads SKILL.md directly
Mar 31, 2026
be56570
Add dismiss/correct commands to memory classification system
Mar 31, 2026
de8d4dd
Enforce draft_email usage — never send emails directly
Mar 31, 2026
a7735ee
Enforce draft-only email policy at tool level
Mar 31, 2026
79b4e99
Add shared mailbox support for email drafts
Mar 31, 2026
6cd21f8
Add plugin and browser bridge installation to core-setup.sh
Mar 31, 2026
0129eb0
Restore generic SOUL.md + m365-tools, apply draft-only email policy
Mar 31, 2026
e989599
Generalize plugins and scripts — remove all user-specific hardcoding
Mar 31, 2026
4fc5604
Remove all CRITICAL user-specific hardcoding from repo
Mar 31, 2026
2550439
Generalize bates-enhance + remove hardcoded Azure IDs
Mar 31, 2026
254d0e8
Add Operational Rules Layer — Steps 1-3
Apr 1, 2026
0bf6adc
Add Operational Rules Layer — Steps 4-6
Apr 1, 2026
90f76eb
Add Operational Rules Layer — Steps 7-10
Apr 1, 2026
115d381
Fix gateway stability: channel-bridge delivery, m365-safety cleanup, …
Apr 1, 2026
43bc637
Update reapply-patches.sh for OpenClaw v2026.4.1
Apr 2, 2026
3fdb2bd
Update cost-tracker to use native message_sending hook
Apr 2, 2026
8dfcd3c
Add xAI/Grok as bundled provider option
Apr 4, 2026
49d55ac
Add data sharing warning for xAI/Grok provider
Apr 4, 2026
e5ee804
Remove Anthropic subscription auth — API key only
Apr 4, 2026
5375795
Add Providers management panel to dashboard
Apr 6, 2026
c22e947
Activate rules layer: add SOUL.md rule awareness + verify all scripts…
Apr 6, 2026
9f2601b
Integrate rules panel into Mission Control main nav
Apr 6, 2026
e336dfb
Add Memory and Operational Rules sections to README
Apr 6, 2026
c2b2ac7
Add OpenClaw 2026.4.5 batch 1 patches and update runbook
Apr 6, 2026
88c0602
Add batch 2 patches for OpenClaw 2026.4.5 (Teams cards / thinking bub…
Apr 6, 2026
9c1d231
Fix subagentName ReferenceError in 4.5 announce flow + update deps
Apr 6, 2026
7e088bb
Add threaded delivery, Adaptive Card standup, and interactive action …
Apr 6, 2026
3477061
Add agent avatar cards and fix email drafts to use Outlook Drafts folder
Apr 6, 2026
4c712d3
Document cost footer patch for 4.5 Teams delivery path + peer deps
Apr 6, 2026
b26c1d6
Move browser control extension from core to enhance (opt-in)
Apr 7, 2026
1dde6a4
Fix channel-bridge subscription startup race condition
Apr 7, 2026
7121eff
Fix channel-bridge TEAM_ID race, add subscription retry, dynamic To D…
Apr 7, 2026
cfc2185
Add installer source sync to build script (Step 4b)
Apr 7, 2026
c503279
Fix Tailscale install: ensure curl + passwordless sudo before install
Apr 7, 2026
49360b0
Fix Tailscale auth flow: start daemon first, increase timeout, sudo -n
Apr 7, 2026
99c67b4
Install WSL Ubuntu distro at Tailscale step if not present
Apr 7, 2026
30541d5
Merge Tailscale auth into Installing step — fully automated
Apr 7, 2026
b97b269
Fix installer hanging: set BATES_NONINTERACTIVE, fix scheduled task d…
Apr 7, 2026
de543ef
Fix auto-logon skip in non-interactive mode (password prompt was stil…
Apr 7, 2026
511fe92
Fix Tailscale installer: hard timeouts + hidden CMD windows
Apr 7, 2026
1763416
Fix Tailscale Serve: auto-open enable URL + timeout
Apr 7, 2026
51eedaa
Add user action banner for Tailscale Serve enable step
Apr 7, 2026
0c158ef
Fix WSL keepalive: use detected distro name instead of hardcoded "Ubu…
Apr 7, 2026
e4d6c3d
Fix Teams manifest + zip: case-insensitive bool check, install zip
Apr 7, 2026
09ba7d8
Fix Tailscale Serve URL opening: use powershell.exe fallback
Apr 7, 2026
f7cb4f1
Automate Teams app sideloading via Graph API + add OAuth scopes
Apr 7, 2026
4e495d4
Remove duplicate Tailscale auth, fix browser open, add user instructions
Apr 7, 2026
686cf99
Fix apt lock: kill unattended-upgrades, longer wait, cleanup stale locks
Apr 8, 2026
eeb42f0
Disable unattended-upgrades during install, re-enable after
Apr 8, 2026
9925e5a
Fix unbound variable: BATES_TEAMS_ENABLED with set -u
Apr 8, 2026
50b39bb
Fix Tailscale Serve: try first, only prompt if needed
Apr 8, 2026
6bad3b6
Hide WSL keepalive/watchdog CMD windows via powershell -WindowStyle H…
Apr 8, 2026
8d8cce3
Use tailscale funnel instead of serve for public HTTPS access
Apr 8, 2026
088d053
Pin OpenClaw to v2026.4.5 — v4.8 breaks msteams patches and is heavier
Apr 8, 2026
7644d53
Auto-start Teams bot creation when M365 work token is available
Apr 8, 2026
f27896f
Add debug logging to Teams onNext callback
Apr 8, 2026
22c3ef7
Keep install-config.json after install for debugging
Apr 8, 2026
88f7bb6
Show Tailscale hostname on Success page, pass through from Installing
Apr 8, 2026
51d230b
Eliminate CMD windows: replace bat files with hidden PowerShell scripts
Apr 8, 2026
823d8c4
Client installer: auto-install Tailscale + discover server on tailnet
Apr 8, 2026
ad6bb8d
Add CLAUDE.md: full install history, bugs, fixes, current state
Apr 8, 2026
8c28564
Fix mailing list: Rust-side HTTP call + all pending fixes for rebuild
Apr 8, 2026
73f6a55
Critical fixes from code review: token scopes, icon sizes, var ordering
Apr 8, 2026
e3bf3fb
Update CLAUDE.md with code review findings
Apr 8, 2026
ba1222b
Ship pre-sized Teams icons (192x192 + 32x32), remove Pillow dependency
Apr 8, 2026
681b01e
Fix build: JSX syntax error in Success.tsx + auto-detect WSL distro name
Apr 8, 2026
b057fcb
Add working indicator to install log — animated dots during long steps
Apr 8, 2026
7d55419
Fix WSL distro detection: handle UTF-16 output from wsl -l -q
Apr 8, 2026
5b1bb5d
Remove Application.ReadWrite.All from assistant email OAuth
Apr 8, 2026
0096d86
Revert M365 OAuth to basic scopes, auto-start uses Teams-specific OAuth
Apr 8, 2026
ad6a3da
Fix OAuth scope swap: M365 had Teams admin scopes, Teams had basic sc…
Apr 8, 2026
bc35439
Restore original OAuth scopes + fix Teams consent not persisting
Apr 8, 2026
9973d5d
Fix Discord gateway crash loop + heartbeat task dedup
Apr 8, 2026
fa02420
Replace structured CHANGE/IMPACT/ACTION/STATUS format with prose
Apr 8, 2026
05f2edb
Fix Soren GitHub monitoring: use mcporter exec instead of native tools
Apr 8, 2026
5dca4a5
Add CRM rule: mandatory logging + project tagging
Apr 9, 2026
f5b6270
Add CRM plugin, Perplexity plugin, Directus UI, fix sidebar patch
Apr 11, 2026
5a9b83a
Add canonical rules codifier specification
Apr 12, 2026
0047e5d
Comprehensive cron audit fixes + evening debrief pipeline + rules UI
Apr 12, 2026
eefb757
Sync runtime changes + OpenClaw 4.11 update compatibility
Apr 12, 2026
1aa282c
Adaptive Cards for all briefings + 4.12 features + cost fix
Apr 13, 2026
c45aa80
Enforce clickable markdown links across all agents
Apr 13, 2026
85b7e16
Cost footer: model-agnostic sub detection + deduplicate + CRM task tools
Apr 13, 2026
52ea685
Add CRM task tools, Outlook draft creation, and service watchdogs
Apr 14, 2026
e4c9fef
Add CRM integration installer + Mixpost watchdog/Tailscale
Apr 14, 2026
b71dc5f
CRM installer: download CRM CLI from github.com/jdanielnd/crm-cli rel…
Apr 14, 2026
c8b9573
Mission Control: add CRM integration to Enhance panel
Apr 14, 2026
7c2a5eb
CRM installer: Directus-embedded Bates drawer + AI harness removal
Apr 16, 2026
e1a43c3
crm-tools + mcporter pin + memory digest refresher + Teams markdown
Apr 20, 2026
6157d90
feynman-tools: research-workflow integration
Apr 21, 2026
be3df57
dashboard: arxiv status reads mcp.json, not a missing script
Apr 21, 2026
d3a005c
postiz integration: self-host scheduler + Bates tools + MC tile
Apr 21, 2026
fafd046
Enhance panel: Setup button actually runs setup
Apr 21, 2026
78662b9
Social nav: turn hardcoded Mixpost link into dropdown (Mixpost + Postiz)
Apr 21, 2026
628cbeb
compose: detect docker compose v2 plugin vs docker-compose v1
Apr 21, 2026
123e380
Revert: remove Postiz integration
Apr 21, 2026
90fdc7a
Installer: LSA auto-logon, bump to 2026.4.22 / gpt-5.5, Discord zombi…
Apr 23, 2026
d2c597e
Move BatesCore.iss to old/ — dead code, Tauri is the only build path
Apr 24, 2026
65dad28
Installer: bump openclaw pin 2026.4.22 → 2026.4.24
Apr 26, 2026
73d623d
Sync live → repo: 5 plugins + 41 scripts (post-2026.4.24 update)
Apr 26, 2026
55c6030
Dashboard: refresh agent model dropdowns + ALLOWED_MODELS to current …
Apr 26, 2026
74152c1
Installer GUI: refresh Anthropic model picker to current generation
Apr 26, 2026
5e79adb
Installer: reorder providers — OpenAI / Codex first, then Google, the…
Apr 26, 2026
93c039d
Dashboard: fix /agents/update-model — accept {primary, fallbacks} object
Apr 26, 2026
5fa1b00
Installer: kernel overcommit guardrail to stop WSL OOM cascade
Apr 26, 2026
aadbdf2
Installer: restore exec bit on memory-watchdog.sh dropped by 9p edit
Apr 26, 2026
39b27f2
Subagent policy: document context: "isolated" vs "fork" (OpenClaw 202…
Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Build output
build/output/
*.exe

# OS files
.DS_Store
Thumbs.db
desktop.ini

# Node
node_modules/
npm-debug.log

# Plugin data (runtime, not shipped)
bates-core/plugins/*/data/
bates-core/plugins/*/node_modules/
bates-enhance/integrations/*/node_modules/

# IDE
.vscode/
.idea/
*.swp
*.swo

# Secrets (should never be committed)
*.env
.env.*
credentials.json
auth-profiles.json
*.key
*.pem

# Temporary
*.tmp
*.bak
*.orig

# Search index data
bates-enhance/integrations/search/search-index/db/
bates-enhance/integrations/search/search-index/venv/
179 changes: 179 additions & 0 deletions BATES_RULES_CODIFIER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# BATES_RULES_CODIFIER.md

**Canonical specification for the Bates Operational Rules Layer.**
**This file is the source of truth. Do not improvise.**

---

## Purpose

The Rules Codifier is the deterministic infrastructure layer for Bates. It progressively replaces probabilistic LLM behavioral rules with deterministic bash scripts. Every rule that gets codified becomes reliable, token-free, and audit-friendly. The goal is structural reliability through accumulation, not perfection through complexity.

This is the SynapseLayer four-pillar architecture applied to a single agent: extract patterns from observed behavior and source documents, store them as a rule book, codify the deterministic ones into executable scripts, and let the agent run operations through the constrained interface rather than the unconstrained one.

---

## Architecture: the six-stage chain

### Stage 1 — daily-pattern-observer (jules, 13:30 daily)

Reads agent findings, deal pipeline, calendar, drafts, coding activity. Synthesizes into tagged patterns: FOCUS / HOT / GAP / OPPORTUNITY. Writes to `observations/patterns.md` with dated entries and source attribution.

**Status: working, 84 percent hit rate. Leave as is.**

### Stage 2 — pattern-promotion (jules, 05:30 daily)

Runs `promote-patterns.sh`. Scans `findings.md` for decisions repeated three or more times within 30 days across two or more date sections. Candidates get proposed as rules via `classify-memory.sh rule "..." --type reactive --tier t2`. Writes to `observations/rules.md`.

**Status: working, 100 percent hit rate. Leave as is.**

### Stage 3 — rules-codifier (jules, 05:00 daily)

Reads `rules/` directory plus `observations/rules.md` plus `observations/patterns.md`. Identifies one (1) procedural rule per run that can become a bash script. Writes the script to `~/.openclaw/scripts/`. Updates the rules file to reference the script. Appends one entry to `rules-to-scripts.md`.

**Critical architectural constraint: one candidate per run, never more.** This is the fix for the crash loop. If the codifier tries to process multiple candidates per run, any single failure kills the whole run and the system stays crashed. One candidate per run produces 30 codified rules per month, which is the right cadence for compounding reliability.

**Codification criteria. Codify when:**
- The procedure has three or more steps
- Contains hardcodeable values such as IDs, tokens, or endpoints
- Has been violated two or more times because the model did not read or follow it
- Can be expressed as a deterministic bash script with no judgment required

**Keep as a rule when:**
- Requires judgment, tone, or communication style
- Involves contextual reasoning ("consider the audience")
- Encodes policy constraints ("no external emails to non-whitelisted domains")
- Changes frequently based on Robert's preferences

**Status: just rewritten to one-candidate-per-run. Verify the next 7 daily runs all complete without crashing before declaring fixed.**

### Stage 4 — extraction-queue-processor (main, 04:00 daily)

Reads `observations/extraction-queue.md`. For each `[pending]` document, reads it, extracts obligations, deadlines, and rules, writes the extracted items as `[PROPOSED]` rules into `observations/rules.md`.

**The queue is populated by Stage 4a (the evening check-in), not by automated email scanning.** Automated email feeding is rejected because the token cost of reading every attachment exceeds the value of the rules extracted.

**Status: currently empty because Stage 4a does not exist yet. Building Stage 4a is the highest-priority fix.**

### Stage 4a — evening-check-in (main, 19:00 daily)

**This is the new stage. It is what makes Stage 4 work.**

At 19:00 every evening, Bates posts a single Teams message to Robert with the following exact format:

```
Evening check-in. Anything to codify today?

Reply with one of:
[skip] - nothing today
[doc] <path or attachment> - extract rules from this document
[rule] <text of the rule> - propose this rule directly
[pattern] <description> - flag this as a pattern to watch

Multiple replies allowed. Reply [done] when finished.
```

Robert replies in natural language. Bates parses the reply against the four prefixes. For each `[doc]` reply, Bates appends a `[pending]` entry to `extraction-queue.md` with the document path or downloads the attachment to `extraction-queue/inbox/` and references it. For each `[rule]` reply, Bates appends a `[PROPOSED]` rule directly to `observations/rules.md` (skipping the extraction step). For each `[pattern]` reply, Bates appends a dated entry to `observations/patterns.md` under a new section called "manual-flags." If Robert replies `[skip]` or does not reply within 60 minutes, Bates records the skip in `evening-check-in.log` and exits.

**Critical design constraint: this is not a conversation.** Bates posts the prompt, parses the reply against the prefixes, takes the actions, and exits. No follow-up questions. No clarification requests. No confirmation messages beyond a single line summary when `[done]` is received: "Logged: 2 docs to extraction queue, 1 rule proposed, 1 pattern flagged."

**Status: needs to be built. This is the priority fix.**

### Stage 5 — rules-digest (main, 07:00 daily)

Morning summary delivered to Robert via Teams with five lines:

```
Bates rules digest, [date]
- Documents extracted yesterday: N
- Rules proposed yesterday: N
- Rules codified yesterday (Stage 3): 0 or 1
- Total scripts in ~/.openclaw/scripts/: N
- Total rules remaining as judgment calls in rules/: N
```

No additional formatting. No commentary. No suggestions. Just the five numbers.

**Status: broken because upstream is empty. Will start working automatically once Stages 4a and 4 produce real activity. Do not rewrite Stage 5 first; it is downstream of the fix.**

### Stage 6 — reliability-metric (main, weekly, Sunday 20:00)

**This is the new measurement stage. It is what turns Bates into a publishable artifact.**

For each script in `~/.openclaw/scripts/`, log every invocation with timestamp and exit code. The logging is passive: each script's first line is `echo "$(date -Iseconds) $0 $@" >> ~/.openclaw/scripts/.invocation.log`. Once a week, on Sunday at 20:00, a summary script computes:

```
Bates reliability metric, week of [date]
- Total agent actions: N
- Actions through codified scripts: N (X percent)
- Actions through LLM direct: N (Y percent)
- Script invocations by script: <top 10 list>
- New scripts added this week: N
- Reliability trend vs last week: +/-Z percent
```

The reliability metric is the percentage of agent actions that went through codified scripts versus through the LLM directly. This number is the equivalent of fDesk's 99.98 percent accuracy across 100,068 validations, but for a single agent. As the rules codifier runs and the scripts directory grows, this percentage should increase monotonically over months. That trend line is the proof that the architecture works.

**Status: needs to be built. Ship after Stages 4a and 4 are working.**

---

## Data flow

```
Agent sessions
findings.md (Stage 1: observe)
patterns.md (Stage 2: promote)
rules.md (PROPOSED rules)
extraction-queue.md (Stage 4: extract from documents)
evening check-in (Stage 4a: human-curated input)
~/.openclaw/scripts/ (Stage 3: codify)
.invocation.log (Stage 6: measure)
rules-digest at 07:00 (Stage 5: report)
weekly reliability metric Sunday 20:00 (Stage 6: report)
Mission Control Rules tab
```

---

## Implementation order

1. Build Stage 4a (evening check-in) first. Without it, Stage 4 has no input and the whole pipeline starves.
2. Verify Stage 3 (rules-codifier, just rewritten) runs cleanly for 7 consecutive days.
3. Fix Stage 5 (rules-digest) to use the five-line format above.
4. Build Stage 6 (reliability metric). Add the invocation logging line to every existing script in `~/.openclaw/scripts/`. Build the weekly summary script.
5. Run for 30 days. Measure the reliability trend. If it is increasing, the architecture is working.

---

## Anti-requirements

- **No automated email scanning.** Token cost exceeds value. Robert provides the documents through the evening check-in.
- **No multi-candidate codification per run.** One candidate per run, every run. This is the architectural fix for the crash loop and is non-negotiable.
- **No conversational evening check-in.** Bates asks once, parses against the four prefixes, takes the actions, exits. No back-and-forth.
- **No proactive rule suggestions from Bates.** Bates does not propose rules unprompted. The pipeline is human-curated at the input and automatic at the processing.
- **Reference from Soul.md or the existing OpenClaw configuration MDs.** Bates runs on OpenClaw and loads MD files from the OpenClaw convention (Soul.md and others), not CLAUDE.md. Add a single line to Soul.md that points at this spec: `See BATES_RULES_CODIFIER.md for the canonical six-stage rules pipeline specification. The anti-requirements section is binding.` This is one line added to an existing file, not a new file at the repo root.

---

## Success criteria after 30 days

- Stage 4a runs every evening, Robert responds at least 20 of 30 days
- Stage 4 produces at least 10 documents worth of extracted rules over the month
- Stage 3 codifies between 20 and 30 rules into scripts (one per day, allowing for 0-2 misses per week)
- Stage 5 digest is delivered every morning with non-zero numbers
- Stage 6 weekly reliability metric shows an upward trend across all four weeks
- Total scripts in `~/.openclaw/scripts/` grows by 20 to 30 over the month
- Zero crash loops in Stage 3

If all six conditions are met after 30 days, the architecture is working. If any one fails, fix that specific stage rather than redesigning the pipeline.
Loading