Repository navigation
Description
Summary
contextcrawler init -g --codex writes the slim instructions to ~/.codex/RTK.md instead of ~/.codex/CONTEXTCRAWLER.md, and adds an @/Users/thehoff/.codex/RTK.md reference to AGENTS.md without removing the pre-existing @/Users/thehoff/.codex/CONTEXTCRAWLER.md reference from an earlier install — leaving two duplicate imports and a stale orphan file.
Root cause
Commit bcddd06 (fix(hooks): rename hardcoded "rtk hook" commands + RTK.md deployment) flipped the constant in src/hooks/init.rs from "CONTEXTCRAWLER.md" back to "RTK.md":
// Current (regressed):
const RTK_MD: &str = "RTK.md";
const RTK_MD_REF: &str = "@RTK.md";The downstream-fork rebrand to ContextCrawler had explicitly changed these to CONTEXTCRAWLER.md / @CONTEXTCRAWLER.md so the on-disk file name matches the tool name. The rebase from upstream rtk-ai/rtk brought back the upstream constants and the rebrand sweep (c0349b2, 540413e) missed them.
Reproduction
- Run an older contextcrawler that wrote
CONTEXTCRAWLER.mdand patched AGENTS.md with@CONTEXTCRAWLER.md - Upgrade to current develop
- Run
contextcrawler init -g --codex - Observe:
~/.codex/RTK.mdis created (new)~/.codex/CONTEXTCRAWLER.mdstill exists with its old content (orphan)~/.codex/AGENTS.mdnow has both@CONTEXTCRAWLER.mdAND@RTK.mdreferences
Fix
Two parts:
-
Restore the constants in
src/hooks/init.rs:const RTK_MD: &str = "CONTEXTCRAWLER.md"; const RTK_MD_REF: &str = "@CONTEXTCRAWLER.md";
-
Add a legacy-cleanup step in
run_codex_mode_with_paths(): ifRTK.mdexists alongside the canonicalCONTEXTCRAWLER.mdlocation AND/OR@RTK.mdappears in AGENTS.md, remove the orphan file and strip the stale reference. Print a one-line note so users see what was cleaned. -
Regression test that pins the constant:
#[test] fn test_rtk_md_constant_pinned_to_contextcrawler_filename() { // The downstream rebrand requires this file to be named // CONTEXTCRAWLER.md so it matches the tool name on disk. // If you're changing this, you're probably re-introducing // the regression from bcddd06. See issue #N. assert_eq!(RTK_MD, "CONTEXTCRAWLER.md"); assert_eq!(RTK_MD_REF, "@CONTEXTCRAWLER.md"); }
The pinned-constant test means a future rebase will fail the test suite if it re-introduces the regression instead of landing silently.
Scope
- 2 const lines in
src/hooks/init.rs - Cleanup function + AGENTS.md migrator
- 1 pinning test + 1 cleanup test
- No upstream behavior changes
Test plan
-
cargo test --bin contextcrawlerpasses - Pinning test fails if a future change flips the constant back
- Cleanup test fixture: pre-existing
RTK.md+@RTK.mdin AGENTS.md → after init, onlyCONTEXTCRAWLER.mdexists, only@CONTEXTCRAWLER.mdin AGENTS.md - Manual: run
contextcrawler init -g --codexagainst an environment that has the staleRTK.mdand confirm cleanup
Activity
fix(init): restore CONTEXTCRAWLER.md filename + legacy cleanup + regr…
review: address codex feedback on thehoff#19
fix(cli): brand --version output as contextcrawler instead of rtk (th…
chore(branding): finish rtk→contextcrawler sweep in print strings + a…
chore(release): v0.1.7 — version bump + release-engineering rebrand +…
review: narrow branding-lint history-comment exemption to comment lin…