diff --git a/ROADMAP.md b/ROADMAP.md index da9b2ec7..a83ddaf3 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -6557,7 +6557,7 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) Four hardcoded literal `PathBuf::join` calls. No case-folding, no extension variants, no cross-tool alias table, no `.claude/CLAUDE.md` (the official Claude Code documented subdir at `https://docs.anthropic.com/en/docs/claude-code/memory`). The ancestor-walk logic IS present (good — `cursor = dir.parent()`), but it walks looking for these four exact names only. **Status JSON drops the path list:** `rust/crates/rusty-claude-cli/src/main.rs` builds `StatusContext { …, memory_file_count: project_context.instruction_files.len(), … }` (taking only the count), then serializes that field as `workspace.memory_file_count` in the JSON envelope. The original `Vec` with full paths and content is **discarded before reaching the JSON envelope**. **Why distinct from existing items:** ROADMAP mentions `AGENTS.md` 5 times (#215, #216, #225, #231, etc.) but **only as a config-mutation target** ("installer changes AGENTS.md", "AGENTS.md orchestration brain is loaded automatically" — that's the installer/onboarding noise, not the runtime memory loader). Nothing in ROADMAP says "claw-code does not actually read AGENTS.md as a memory file at runtime." #84 covers the dump-manifests `repo root: /Users/...` build-host leak (a different name-identity bug). #1756 mentions ancestor `CLAUDE.md` for worker safety (different concern). No entry documents the discovery name set or the `.claude/CLAUDE.md` blind spot. **Why this matters:** (a) **Cross-tool migration silently breaks.** A user with an existing `AGENTS.md` workflow (Codex, OpenAI Agents, GitHub Copilot Agents — `AGENTS.md` is the de-facto cross-tool standard) installs `claw`, runs it in their existing project, and `status` reports `memory_file_count: 0`. There is **no warning** that `AGENTS.md` was found-but-ignored, no doctor check, no hint. They think claw has no memory of their project rules — claw silently has zero context. (b) **Product-name divergence.** The binary is called `claw`. The discovered file is `CLAUDE.md`. A user typing `CLAW.md` (matching the tool they actually invoked) gets silently zero memory. Same identity-leak pattern as #84 (build-host paths in error messages) — the marketing/binary name diverges from the runtime-effective file name. (c) **Claude Code documented subdir location ignored.** The Claude Code docs at `https://docs.anthropic.com/en/docs/claude-code/memory` document `.claude/CLAUDE.md` as a memory-file location. claw-code (which advertises Claude Code parity throughout `--help` and README) **does not read it**. A user migrating from Claude Code with their memory file at `.claude/CLAUDE.md` gets silently zero memory pickup. (d) **Case-sensitivity is OS-leaky.** On macOS with case-insensitive HFS+/APFS, `claude.md` and `CLAUDE.md` are the same file — discovery happens to work. On Linux/Windows with case-sensitive filesystems, `claude.md` is invisible. Cross-platform users get different memory behavior from the same repo layout. (e) **`memory_file_count: 0` with no `memory_files: []` field means a claw cannot debug "why is my memory not loading?"** without re-implementing the discovery walk itself. (f) The four candidates include `CLAUDE.local.md` and `.claw/instructions.md` — these aren't documented in README or `--help`, and the discovery list itself is a hidden contract. **Required fix shape:** (a) **Extend the discovery name set** to a documented union: `CLAUDE.md`, `CLAUDE.local.md`, `CLAW.md`, `CLAW.local.md`, `AGENTS.md`, `AGENTS.local.md`, plus `.claude/CLAUDE.md` and `.claw/CLAUDE.md`. Optionally allow user-configured extras via `.claw.json` `memory.discoveryNames: ["GEMINI.md", "CONTEXT.md"]`. (b) **Case-fold the comparison** on case-sensitive filesystems — when walking directory entries, match case-insensitively against the discovery name set, so `claude.md` / `CLAUDE.MD` / `Claude.md` all resolve to the same memory file. Document this as the contract. (c) **Expose the full `memory_files[]` array in status JSON**: `workspace.memory_files: [{path: "/abs/CLAUDE.md", source: "project", bytes: 1234}, {path: "/abs/.claw/CLAUDE.md", source: "project_subdir", bytes: 200}]`. Keep `memory_file_count` for back-compat but make the array the source of truth. (d) **Add a `doctor` check `memory_files` that lists discovered files AND files that were skipped because they were in a non-discovered name** (e.g., "found `AGENTS.md` at repo root but not loaded — claw memory discovery uses `CLAUDE.md`; rename or add `memory.discoveryNames` to `.claw.json`"). This turns "silent zero memory" into a visible diagnostic. (e) **Update README and `--help`** to list the discovery name set explicitly. (f) **Regression coverage** for each name in the matrix above, asserting the file is discovered (or, for explicitly-excluded names, that `doctor` produces a "found-but-skipped" hint). **Acceptance check (one-liner):** `for n in CLAUDE.md CLAW.md AGENTS.md .claude/CLAUDE.md; do mkdir -p $(dirname /tmp/cmp/$n); echo test > /tmp/cmp/$n; ( cd /tmp/cmp && claw status --output-format json | jq -e --arg path "/tmp/cmp/$n" '.workspace.memory_files | map(.path) | index($path)' ) || echo "MISS: $n"; rm /tmp/cmp/$n; done` should print no MISS lines. Source: gaebal-gajae dogfood follow-up for the 2026-05-24 10:00 Clawhip pinpoint nudge at message `1508046936177901639`. -460. **`bare_slash_command_guidance` looks up the bare-verb argument against `slash_command_specs().iter().find(|spec| spec.name == command_name)` but never checks `spec.aliases`, so every documented slash-command alias — `skill` (alias of `/skills`), `marketplace` (alias of `/plugin`), `yes`/`y` (aliases of `/approve`), `no`/`n` (aliases of `/deny`), `cwd` (alias of `/workspace`), `plugins` (alias of `/plugin`) — fails the alias lookup and falls into either (a) the "Did you mean" typo path with nonsensical adjacent-prefix suggestions, or (b) the silent fallthrough to LLM Prompt dispatch that demands credentials and burns billable tokens. The canonical names (`skills`, `plugin`, `approve`, `deny`, `workspace`) correctly emit `"\`claw \` is a slash command. … run \`/\` inside the REPL."` guidance** — dogfooded 2026-05-24 for the 10:30 Clawhip pinpoint nudge at message `1508054486134947951`, reproduced on local `./rust/target/debug/claw` `git_sha 003b739d` (origin/main `f8e1bb72`). Triage matrix in clean isolated env (`HOME=/tmp/iso11/home`, fresh `/tmp/iso11/proj` git-init, `claw --output-format json