memory: dream cleanup — dedup DM memory, correct Mail.Send fact, fix index dup

- Merge duplicate DM memories into canonical feedback_dm_wrapping_commands_to_mike
  (points at the productized discord-dm skill; keeps UA/Cloudflare-1010 + 50109
  gotchas); git rm the session-created feedback_dm_wrapped_command_lines duplicate.
- feedback_365_remediation_tool: record that Exchange Operator HAS Graph Mail.Send/
  Mail.ReadWrite (corrects an earlier "suite has no Mail.Send") + the EXO-vs-Graph
  token-audience gotcha + Get-MessageTraceV2 + fresh-onboard EXO 401 propagation.
- Remove a duplicate MEMORY.md index line --apply-safe added from a false-orphan.
- Log the memory-dream false-orphan/dup-index defect to errorlog for skill linting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 11:54:00 -07:00
parent 9960da5f9a
commit 9b9513f69e
5 changed files with 29 additions and 34 deletions

View File

@@ -1,29 +1,31 @@
---
name: feedback_dm_wrapping_commands_to_mike
description: When a command/snippet you want Mike to run is long enough to wrap in the terminal, DM it to him in Discord (code block copies cleanly) instead of only putting it in chat.
description: DM long/wrapping output (commands, consent links, URLs) to Mike in Discord via the discord-dm skill so it copies cleanly — terminal wrapping mangles long single lines on paste.
metadata:
type: feedback
---
Mike (2026-06-13): "For any command that wraps (like this one) DM me in discord, the
line breaks suck." Terminal line-wrapping mangles long one-liners when he copies them.
Mike (2026-06-13): "For any command that wraps (like this one) DM me in discord, the line
breaks suck." Reaffirmed 2026-06-15: any wrapped/long single-line output meant for him to
copy — long one-liners, M365 admin-consent links, URLs with query strings, installer/
enrollment URLs — goes to Mike as a Discord DM, not left only in the terminal. Terminal
wrapping inserts breaks/spaces that corrupt the line on paste.
**How to apply:** When you produce a command/code block for Mike to run that would wrap
in the terminal (long one-liners, multi-flag commands), send it to him via Discord DM as a
```fenced code block``` (Discord copies the whole line cleanly regardless of visual wrap),
and just reference it in chat ("DM'd you the command"). Short, non-wrapping commands can
stay inline.
**How to apply:** Use the **`discord-dm` skill** (the productized mechanism — supersedes the
old ad-hoc `.claude/tmp/discord-dm.py`): `bash .claude/scripts/discord-dm.sh mike "<link-or-command>"`
(or `echo "$X" | bash .claude/scripts/discord-dm.sh mike`). It's prepopulated with org user
IDs (mike/howard/rob/winter) + channel IDs (#bot-alerts/#dev-alerts). Still show the item
inline too, but the DM is the canonical copy-paste source. Short non-wrapping commands stay inline.
**Mechanics (verified working 2026-06-13):**
**Mechanics / gotchas (the skill handles these, but know them):**
- Bot token: vault `projects/discord-bot/bot-token.sops.yaml` field `credentials.bot_token`.
- Mike's Discord user id: `264814939619721216` (Howard: `624667664501178379`).
- **MUST set a `User-Agent` header** like `DiscordBot (https://azcomputerguru.com, 1.0)` --
Discord's API is behind Cloudflare, which returns **403 error 1010** for the default
urllib/curl UA. This is the #1 gotcha; both DM-open and message-send fail without it.
- Open a DM channel: `POST https://discord.com/api/v10/users/@me/channels {"recipient_id":<uid>}`
-> returns channel id; then `POST /channels/<id>/messages {"content": "..."}`.
- Reusable helper written this session: `.claude/tmp/discord-dm.py` (reads body from a file
or stdin; `BOT_TOKEN` from env). The bot CAN initiate DMs to Mike (mutual guild
624663750603046913); the earlier 403 was the missing UA, not a privacy block.
- Mike's Discord uid `264814939619721216` (Howard `624667664501178379`).
- **MUST set a `User-Agent` header** (e.g. `ClaudeToolsBot (claudetools, 1.0)`) — Discord's API
is behind Cloudflare, which 403s (errcode 1010) the default urllib/curl UA.
- DM flow: `POST /users/@me/channels {"recipient_id":<uid>}` → channel id, then
`POST /channels/<id>/messages`.
- Build JSON with `jq -nc --arg` and feed curl via `printf | --data-binary @-`; a direct
`-d "$(...)"` mangles multiline content → Discord `50109 invalid JSON body`.
Related: [[reference_resource_map]] (Discord bot), the `discord-bot` project.
Related: [[feedback_ascii_only_api_payloads]] (ASCII-only in Discord/coord payload text),
[[reference_resource_map]] (Discord bot), the `discord-bot` project.