Skip to content

feat(commands): /link and /attach structured stash#138

Closed
BunsDev wants to merge 1 commit into
mainfrom
feat/stash-link-attach
Closed

feat(commands): /link and /attach structured stash#138
BunsDev wants to merge 1 commit into
mainfrom
feat/stash-link-attach

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds /link and /attach — a structured, personal, local stash for URLs and file attachments.

Context

Changes

  • claurst_core::stash: StashStore over ~/.coven-code/stash.sqlite with links and attachments, tags, project/session metadata, search, and removal; attachments are copied into ~/.coven-code/attachments/<id>/ so the stored copy survives source moves/deletions.
  • /link <url> | add | list [--tag|--project] | search | remove and /attach <path> | add | list | search | show | remove, with --title/--note/--tags flags.
  • Both commands refuse in hosted review mode, with tests.
  • Palette entries for attach/link; registry-coverage test passes.
  • docs/commands.md documents both commands under Search & Files.

Validation

Record exact commands and outcomes. Mark items N/A with a reason when they do not apply.

  • git diff --check — clean.
  • cargo fmt --all — clean.
  • cargo check --workspace — passed.
  • cargo clippy --workspace --all-targets -- -D warnings — passed.
  • Targeted/manual checks: cargo test -p claurst-core stash (5 passed), cargo test -p claurst-commands stash (3 passed), cargo test -p claurst-commands refuses_hosted (2 passed), cargo test -p claurst-commands prompt_slash (registry coverage, 1 passed).
  • Not run: full cargo test --workspace — additive feature; all touched crates' relevant suites plus workspace check/clippy cover it.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • User-facing docs/help were updated or are not needed.
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks or follow-up work are listed above.

Adds a personal local stash for links and file attachments backed by
~/.coven-code/stash.sqlite. /link saves URLs with title/note/tags and
project/session metadata; /attach copies files into
~/.coven-code/attachments/<id>/ so the stored copy survives moves and
deletions. Both support add/list/search/remove (plus /attach show),
tag and project filtering, and refuse to operate in hosted review mode
since the stash is a personal store.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 7, 2026 07:19
@BunsDev BunsDev added the crate:tui Terminal UI crate (src-rust/crates/tui) label Jul 7, 2026
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 7, 2026 7:19am

@BunsDev BunsDev added crate:core Core crate (src-rust/crates/core) crate:commands Commands crate (src-rust/crates/commands) labels Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “structured stash” feature to Coven Code, backing the new /link and /attach slash commands with a durable local SQLite store and wiring the commands into the commands registry, TUI palette, and user docs.

Changes:

  • Introduces claurst_core::stash (StashStore) for persistent storage of links and attachment metadata, plus copying attachments into ~/.coven-code/attachments/.
  • Adds /link and /attach commands (argument parsing, hosted-review refusal, formatting, and tests) and registers them in the commands registry.
  • Updates the TUI slash-command palette entries and documents the new commands in docs/commands.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src-rust/crates/tui/src/app.rs Adds /attach and /link to the slash-command palette/autocomplete list.
src-rust/crates/core/src/stash.rs New SQLite-backed stash implementation for links and attachments (plus unit tests).
src-rust/crates/core/src/lib.rs Exposes the new stash module from claurst_core.
src-rust/crates/commands/src/lib.rs Implements /link + /attach, argument parsing helpers, hosted-review refusal, formatting, registration, and tests.
docs/commands.md Documents /link and /attach under “Search & Files”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10209 to +10221
for token in args.split_whitespace() {
if let Some(name) = token.strip_prefix("--") {
if let Some(flag) = current_flag.take() {
flags.insert(flag, current_value.join(" "));
current_value.clear();
}
current_flag = Some(name.to_string());
} else if current_flag.is_some() {
current_value.push(token.to_string());
} else {
positional.push(token.to_string());
}
}
.file_name()
.map(|f| f.to_string_lossy().to_string())
.unwrap_or_else(|| "attachment".to_string());
let dest_dir = attachments_dir.join(&id[..8]);
Comment on lines +326 to +330
let stored = Path::new(&item.value);
let _ = std::fs::remove_file(stored);
if let Some(dir) = stored.parent() {
let _ = std::fs::remove_dir(dir);
}
Comment thread docs/commands.md
/link remove <id> — delete a link
```

`/link list` shows each entry's short id, save date, title, URL, and tags. `--project` limits the listing to links saved from the current repository. The stash is a personal local store and is disabled in [hosted review mode](configuration#hosted-review-mode).
@BunsDev

BunsDev commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Superseded by #135, which merged the same /link and /attach stash feature (main's version also adds quoted-path support). Closing.

@BunsDev BunsDev closed this Jul 7, 2026
@BunsDev
BunsDev deleted the feat/stash-link-attach branch July 7, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate:commands Commands crate (src-rust/crates/commands) crate:core Core crate (src-rust/crates/core) crate:tui Terminal UI crate (src-rust/crates/tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants