You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It’s that time again: I opened this repo, took a deep breath, and promptly regretted every life choice that led me here. The code is 60% good intentions, 30% duct tape, and 10% “surely no one will ever do that” optimism. I’m here to be your brutally honest rubber duck with a flamethrower. Buckle up, buttercup. 💣🔥
☠️ Revert eagerly deletes config.toml as “extra cleanup,” even when it’s a legit project file.
The “clean up extra agent files” list includes a generic config.toml — like, universally common config name; what could go wrong? Everything. 💥 If you’ve ever used TOML for anything else (you have), Revert can nuke it with no mercy when there’s no .bak.
The “Open Hands” adapter points directly to project-root config.toml. If that path exists without a Ruler backup, it gets unlinked. Hope you didn’t need your configuration! 🤡
case'Open Hands':
// For Open Hands, we target the main config file, not a separate mcp.jsoncandidates.push(path.join(projectRoot,'config.toml'));
Suggestions
Only delete files that:
Have a .bak, or
Are listed in a manifest produced by apply, or
Contain a clear Ruler provenance marker comment.
Gate config.toml removal behind “contains OpenHands MCP markers” or backup presence only; otherwise skip with a warning.
Add a --force-extra-cleanup flag to enable aggressive deletions; default to safe behavior.
Log loudly when skipping deletion of generic files; this is not something to be “quiet” about.
Dry‑Run Logging Bug in Revert
🤦 Template literals log the function actionPrefix itself instead of the computed prefix — the logs are nonsense, like your linter gave up.
Several places interpolate ${actionPrefix} instead of the local prefix value. In dry-run mode, logs read like a stack trace had a stroke. This makes debugging revert behavior super fun. Not.
The correct pattern is used elsewhere in the file. Copy/paste claimed another victim.
logVerbose(`${actionPrefix} Would remove empty VSCode settings file`,verbose,);
...
`${actionPrefix} Would remove augment.advanced section from ${settingsPath}`
Replace all ${actionPrefix} with a local prefix = actionPrefix(dryRun) and interpolate ${prefix}.
Add a unit test that captures logged output for dry-run vs non-dry-run to prevent this regression.
Consider a tiny logger wrapper that returns a bound logger object with mode baked-in to kill this class of bugs.
Recursive Scans Dive Into node_modules
🐌 Your recursive .ruler discovery happily spelunks through node_modules and friends. Performance bellyflop incoming.
The directory walk skips “hidden” dirs only, but not the common megafolders like node_modules, dist, build, etc. Enjoy your accidental 150k-directory traversal every time. 😵💫
This impacts commands that rely on hierarchical discovery and any read of markdown under .ruler.
}else{// Recursively search subdirectories (but skip hidden directories like .git)if(!entry.name.startsWith('.')){awaitfindRulerDirs(fullPath);}}
Suggestions
Exclude known heavy dirs by default: node_modules, dist, build, out, .next, .turbo, target, vendor, coverage, etc.
Add a glob-based “ignore” option to the scan and pipe CLI flags through to it.
Cap recursion depth or file count in pathological repos; warn when caps are hit.
Ambiguous Agent Config Mapping Clobbers Settings
🎯 Substring matching between config keys and agent display names is a landmine of accidental matches.
mapRawAgentConfigs maps by exact identifier OR substring of display name. If multiple display names include the substring (shockingly common), last write wins. Silent override party! 🎉
This behavior is unpredictable and almost certainly not what users intend. The function doesn’t even stop at the first match — it keeps bulldozing.
Match only by exact identifier (e.g., copilot, claude, etc.). Drop name-based substring heuristics — they’re chaos.
If you keep display-name matching, require full-word matching and error on ambiguity. Log a warning if multiple candidates exist.
Add tests for ambiguous cases to lock behavior down.
Global Config Logging Is Noisy Footgun
📣 On failure to stat the global config dir, you console.error the OS path every time. It’s not an error; it’s expected.
When local .ruler isn’t found and global config doesn’t exist, findRulerDir logs a scary error even though it’s a totally normal situation. Hello, noise. 🥁
This pollutes stderr and makes real problems harder to spot.
Add engines with "node": ">=18" and enforce via CI, or
Replace with a safe deep clone: JSON.parse(JSON.stringify(existingSettings)) for this config shape.
Add a tiny helper clone<T>(obj: T): T to centralize the approach and future-proof it.
If you were hoping this would be a love letter, sorry. But good news: these issues are fixable, and the fixes are small and independent. Do them, and your repo will smell less like a burning datacenter and more like a mildly stressed developer’s desk plant. 🌿✨
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This Codebase Smells!
It’s that time again: I opened this repo, took a deep breath, and promptly regretted every life choice that led me here. The code is 60% good intentions, 30% duct tape, and 10% “surely no one will ever do that” optimism. I’m here to be your brutally honest rubber duck with a flamethrower. Buckle up, buttercup. 💣🔥
Table of Contents
Overzealous Revert Deletes Real Files
☠️ Revert eagerly deletes
config.tomlas “extra cleanup,” even when it’s a legit project file.config.toml— like, universally common config name; what could go wrong? Everything. 💥 If you’ve ever used TOML for anything else (you have), Revert can nuke it with no mercy when there’s no.bak.config.toml. If that path exists without a Ruler backup, it gets unlinked. Hope you didn’t need your configuration! 🤡Files
src/core/revert-engine.tssrc/paths/mcp.tssrc/core/apply-engine.tsCode
config.toml:config.toml:Suggestions
.bak, orapply, orconfig.tomlremoval behind “contains OpenHands MCP markers” or backup presence only; otherwise skip with a warning.--force-extra-cleanupflag to enable aggressive deletions; default to safe behavior.Dry‑Run Logging Bug in Revert
🤦 Template literals log the function
actionPrefixitself instead of the computed prefix — the logs are nonsense, like your linter gave up.${actionPrefix}instead of the localprefixvalue. In dry-run mode, logs read like a stack trace had a stroke. This makes debugging revert behavior super fun. Not.Files
src/core/revert-engine.tsCode
${actionPrefix}instead of${prefix}:Suggestions
${actionPrefix}with a localprefix = actionPrefix(dryRun)and interpolate${prefix}.Recursive Scans Dive Into node_modules
🐌 Your recursive
.rulerdiscovery happily spelunks throughnode_modulesand friends. Performance bellyflop incoming.node_modules,dist,build, etc. Enjoy your accidental 150k-directory traversal every time. 😵💫.ruler.Files
src/core/FileSystemUtils.tsCode
Suggestions
node_modules,dist,build,out,.next,.turbo,target,vendor,coverage, etc.Ambiguous Agent Config Mapping Clobbers Settings
🎯 Substring matching between config keys and agent display names is a landmine of accidental matches.
mapRawAgentConfigsmaps by exact identifier OR substring of display name. If multiple display names include the substring (shockingly common), last write wins. Silent override party! 🎉Files
src/core/config-utils.tsCode
Suggestions
copilot,claude, etc.). Drop name-based substring heuristics — they’re chaos.Global Config Logging Is Noisy Footgun
📣 On failure to stat the global config dir, you
console.errorthe OS path every time. It’s not an error; it’s expected..rulerisn’t found and global config doesn’t exist,findRulerDirlogs a scary error even though it’s a totally normal situation. Hello, noise. 🥁Files
src/core/FileSystemUtils.tsCode
Suggestions
verboseonly, or downgrade to a quiet warning that doesn’t include the error object.nullsilently; normal flow should not shout.Node Compatibility: structuredClone Usage
🪵 Using
structuredClonecan explode on older Node runtimes. Enjoy the runtime faceplant.structuredCloneis used to copy settings before merge. That’s cute, but Node 16 users won’t find it funny when it’s undefined at runtime. 🤡Files
src/vscode/settings.tspackage.json(noenginesfield)Code
structuredClone:{ "name": "@intellectronica/ruler", ... "dependencies": { ... } }Suggestions
engineswith"node": ">=18"and enforce via CI, orJSON.parse(JSON.stringify(existingSettings))for this config shape.clone<T>(obj: T): Tto centralize the approach and future-proof it.If you were hoping this would be a love letter, sorry. But good news: these issues are fixable, and the fixes are small and independent. Do them, and your repo will smell less like a burning datacenter and more like a mildly stressed developer’s desk plant. 🌿✨
Beta Was this translation helpful? Give feedback.
All reactions