Skip to content

fix(clean): fix 3 bugs causing clean command to silently fail#4

Open
jestersimpps wants to merge 12 commits intomainfrom
fix/clean-script-bugs
Open

fix(clean): fix 3 bugs causing clean command to silently fail#4
jestersimpps wants to merge 12 commits intomainfrom
fix/clean-script-bugs

Conversation

@jestersimpps
Copy link
Owner

What broke

The /clean command was detecting issues but not fixing them. Three root causes:

1. library in ALLOWED_DIRS

library/ was explicitly whitelisted, so it was never reported as an unknown directory and never moved to apps/.

2. traits.json in MD_DIR_EXCEPTIONS

personality/traits.json was hardcoded as an exception, so it was never flagged as a non-.md file in a md-only directory.

3. .cache deletion blocked in sandbox

.cache was in TEMP_DOTDIRS which tried rmSync (recursive delete). The sandbox blocks rm -rf style operations, causing a silent failure. Fixed by catching the error and falling back to renaming into apps/.

Changes

  • Remove library from ALLOWED_DIRS
  • Remove traits.json from MD_DIR_EXCEPTIONS (empty the map)
  • Remove .cache from TEMP_DOTDIRS so it is treated as a regular unknown dir
  • Add sandbox-safe fallback in applyIssues: if rmSync fails, rename to apps/ instead

jestersimpps and others added 12 commits February 27, 2026 10:09
…ty tool

Remove approval flow — OBOL has full autonomy over its own personality files.
Direct write + reload, logged to personality/edits/ for audit trail.
#1 tools/personality.js: context.reloadPersonality -> context._reloadPersonality
#2 journal.js + 006_obol_journal.sql: add user_id column, filter by user_id
#3 tool-registry.js: propose_personality_edit -> edit_personality in INPUT_SUMMARIES
#4 db/migrate.js: add obol_journal table with user_id to migration statements
#5 curiosity.js: cap handoff notes to last 3 entries (prune older ones)
#6 curiosity.js: skip handoff/journal entries when no items were stored (count === 0)
#7 chat.js: reloadPersonality passes PERSONALITY_DIR as sharedDir to loadPersonality
#8 evolve.js: personalityDir -> userPersonalityDir in saveTraits call
#9 tenant.js: personalityDir -> path.join(userDir, personality) in statSync call
- credentials.js: add OBOL_NO_PASS=1 env var to force JSON fallback mode
  (vi.mock('child_process') cannot intercept CJS require() in vitest)
- credentials.js: add OBOL_USERS_DIR env var to redirect secrets.json path
  (getUserDir() caches homedir at load time; process.env.HOME trick doesn't work)
- credentials.test.js: use OBOL_NO_PASS + OBOL_USERS_DIR instead of broken
  child_process mock; clean each test's secrets.json in afterEach to prevent
  state bleed between tests
- post-setup.test.js: mock process.platform via Object.defineProperty to
  simulate non-linux for the 'skips on non-linux' test (we run on Linux)
- Remove 'library' from ALLOWED_DIRS (was silently ignored, never flagged)
- Remove traits.json from MD_DIR_EXCEPTIONS (was whitelisted, never flagged)
- Fix .cache deletion failure in sandbox: rmSync blocked, fall back to renaming into apps/
- Remove .cache from TEMP_DOTDIRS so it is treated as a regular unknown dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant