Skip to content

Commit 3c3c09d

Browse files
amir-promptclaude
andcommitted
feat: add notes-no-messages prompt storage mode and make it default
Add a new prompt_storage mode that stores attestations and metadata in git notes but excludes conversation messages. This is now the default, providing attribution tracking without storing full prompts in notes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4464002 commit 3c3c09d

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/authorship/post_commit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ pub fn post_commit(
108108
}
109109
}
110110
}
111+
"notes-no-messages" => {
112+
// Store attestations and metadata in notes, but exclude messages
113+
// Messages remain only in sqlite (similar to local, but note is still created)
114+
strip_prompt_messages(&mut authorship_log.metadata.prompts);
115+
}
111116
_ => {
112117
// "default" - attempt CAS upload, NEVER keep messages in notes
113118
// Check conditions for CAS upload:

src/config.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,10 @@ impl Config {
243243
&self.api_base_url
244244
}
245245

246-
/// Returns the prompt storage mode: "default", "notes", or "local"
247-
/// - "default": Messages uploaded via CAS API
248-
/// - "notes": Messages stored in git notes
246+
/// Returns the prompt storage mode: "default", "notes", "notes-no-messages", or "local"
247+
/// - "default": Messages uploaded via CAS API, stripped from notes
248+
/// - "notes": Messages stored in git notes (with secret redaction)
249+
/// - "notes-no-messages": Attestations and metadata stored in git notes, but messages excluded
249250
/// - "local": Messages only stored in sqlite (not in notes, not uploaded)
250251
pub fn prompt_storage(&self) -> &str {
251252
&self.prompt_storage
@@ -388,14 +389,14 @@ fn build_config() -> Config {
388389
.or_else(|| env::var("GIT_AI_API_BASE_URL").ok())
389390
.unwrap_or_else(|| DEFAULT_API_BASE_URL.to_string());
390391

391-
// Get prompt_storage setting (defaults to "default")
392-
// Valid values: "default", "notes", "local"
392+
// Get prompt_storage setting (defaults to "notes-no-messages")
393+
// Valid values: "default", "notes", "notes-no-messages", "local"
393394
let prompt_storage = file_cfg
394395
.as_ref()
395396
.and_then(|c| c.prompt_storage.clone())
396-
.unwrap_or_else(|| "default".to_string());
397+
.unwrap_or_else(|| "notes-no-messages".to_string());
397398
let prompt_storage = match prompt_storage.as_str() {
398-
"default" | "notes" | "local" => prompt_storage,
399+
"default" | "notes" | "notes-no-messages" | "local" => prompt_storage,
399400
other => {
400401
eprintln!(
401402
"Warning: Invalid prompt_storage value '{}', using 'default'",
@@ -627,7 +628,7 @@ fn apply_test_config_patch(config: &mut Config) {
627628
}
628629
if let Some(prompt_storage) = patch.prompt_storage {
629630
// Validate the value
630-
if matches!(prompt_storage.as_str(), "default" | "notes" | "local") {
631+
if matches!(prompt_storage.as_str(), "default" | "notes" | "notes-no-messages" | "local") {
631632
config.prompt_storage = prompt_storage;
632633
} else {
633634
eprintln!(

0 commit comments

Comments
 (0)