Skip to content

Tdn in cowork#43

Open
dannysmith wants to merge 4 commits intomainfrom
tdn-in-cowork
Open

Tdn in cowork#43
dannysmith wants to merge 4 commits intomainfrom
tdn-in-cowork

Conversation

@dannysmith
Copy link
Owner

@dannysmith dannysmith commented Mar 15, 2026

Summary by CodeRabbit

  • Security
    • Improved path validation to recognize sandboxed and mounted directories, reducing unnecessary configuration warnings.
  • Chores
    • Updated ignore rules to exclude local dependency directories from version control.
  • Tests
    • Strengthened unit tests for path handling to be more robust across environments.

dannysmith and others added 3 commits March 15, 2026 01:18
Update the Claude Code plugin to detect and handle Cowork sandboxed
environments: auto-install tdn from GitHub Releases, discover mounted
vault directories, and create local config. Also suppress spurious
"outside home directory" warnings for /sessions/ and /mnt/ paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use homedir() + join() instead of literal '~/tasks' which doesn't
expand the tilde via path.resolve(), causing false warnings when
cwd is outside $HOME.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 60c7dee8-022c-4c2d-8a86-cb58551bb138

📥 Commits

Reviewing files that changed from the base of the PR and between 6a4f333 and 42ef8c8.

📒 Files selected for processing (1)
  • tdn-cli/src/config/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tdn-cli/src/config/index.ts

📝 Walkthrough

Walkthrough

This PR adds node_modules/ to .gitignore, updates vault-path validation to treat sandboxed/mounted paths (/sessions/, /mnt/) as exempt from home-directory warnings, and adjusts tests to use resolved home paths and include cases for these exemptions.

Changes

Cohort / File(s) Summary
Project ignores
/.gitignore
Adds node_modules/ to the ignore list.
Config validation
tdn-cli/src/config/index.ts
Imports sep from path; introduces isSandboxedMount (paths starting with /sessions/ or /mnt/) and refines the warning condition to skip sandboxed/mount paths.
Tests
tdn-cli/tests/unit/config-security.test.ts
Replaces literal ~/tasks with homedir() + path.join; adds tests asserting no warning for /sessions/... and /mnt/... paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 In burrows of code I hop and write,
I hide node modules out of sight,
/sessions/ and /mnt/ now pass along,
No warning bells, the tests sing a song,
A nimble hop—config feels right.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Tdn in cowork' is vague and lacks specificity about the actual changes made in the pull request. Revise the title to be more descriptive, such as 'Support sandboxed mounts and cowork VMs in vault path validation' to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tdn-in-cowork
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tdn-cli/src/config/index.ts`:
- Line 75: The home-directory check incorrectly treats paths like
"/home/alice2/..." as inside "/home/alice"; update the condition that uses
absolutePath and home (alongside isTempDir and isSandboxedMount) to perform a
proper path-boundary check by comparing equality or a prefix that includes the
path separator: replace the naive absolutePath.startsWith(home) use with a check
such as (absolutePath === home || absolutePath.startsWith(home + path.sep)) (use
Node's path.sep) or use path.relative(home, absolutePath) and ensure it does not
start with '..' to determine "inside home" before skipping the warning; keep the
existing isTempDir and isSandboxedMount logic intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c006a087-70ae-45c2-ae48-ecce581f7b3b

📥 Commits

Reviewing files that changed from the base of the PR and between 0688e08 and 6a4f333.

⛔ Files ignored due to path filters (5)
  • docs/tasks-todo/task-x-claude-cowork-integration.md is excluded by !**/*.md
  • tdn-claude-plugin/README.md is excluded by !**/*.md
  • tdn-claude-plugin/commands/prime.md is excluded by !**/*.md
  • tdn-claude-plugin/skills/task-management/SKILL.md is excluded by !**/*.md
  • tdn-claude-plugin/skills/task-management/cowork.md is excluded by !**/*.md
📒 Files selected for processing (3)
  • .gitignore
  • tdn-cli/src/config/index.ts
  • tdn-cli/tests/unit/config-security.test.ts

Use path.sep to prevent false matches where /home/alice2 would
incorrectly be treated as inside /home/alice. Also fix formatting
to satisfy Prettier.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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