Skip to content

Conversation

@jwiegley
Copy link

Summary

  • Adds include_prompts_in_repositories config option to whitelist repositories for enterprise prompt storage (CAS)
  • Adds default_prompt_storage config option to specify fallback storage mode for non-whitelisted repos
  • Adds PromptStorageMode enum for type-safe handling of storage modes
  • Updates effective_prompt_storage() resolver to handle the new whitelist logic with proper precedence

Motivation

This enables two common use cases:

User A (wants git-ai everywhere, CAS for work repos, notes for OSS):

{
  "prompt_storage": "default",
  "include_prompts_in_repositories": ["https://github.com/myorg/*"],
  "default_prompt_storage": "notes"
}

User B (wants git-ai only for work repos with CAS):

{
  "prompt_storage": "default",
  "allow_repositories": ["https://github.com/myorg/*"],
  "include_prompts_in_repositories": ["*"]
}

Changes

  • src/config.rs: Added PromptStorageMode enum, new config fields, effective_prompt_storage() resolver, and tests
  • src/authorship/post_commit.rs: Updated to use new effective_prompt_storage() resolver
  • src/commands/config.rs: Added CLI support for get/set/unset of new config options

Test plan

  • Added unit tests for PromptStorageMode::from_str() and as_str()
  • Added unit tests for effective_prompt_storage() covering:
    • No include list uses global prompt_storage (legacy behavior)
    • Exclude list always wins (returns Local)
    • Wildcard include matches repos without remotes
    • Non-wildcard include with no match uses fallback
    • No fallback configured defaults to Local
    • Pattern matching works correctly
  • All existing tests pass

🤖 Generated with Claude Code

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jwiegley jwiegley force-pushed the feature/include-prompts-in-repositories branch 3 times, most recently from e0beef9 to c9c889d Compare January 17, 2026 00:36
@jwiegley
Copy link
Author

Hmm… When I click on the signing link, it says that I have signed the agreement, but it is not showing up in the status here…

@acunniffe
Copy link
Collaborator

Seems to be working now. I've never see it do that before.

@jwiegley
Copy link
Author

image

@acunniffe acunniffe requested a review from svarlamov January 17, 2026 12:24
@svarlamov svarlamov assigned svarlamov and unassigned svarlamov Jan 17, 2026
This feature enables users to configure which repositories should use
the enterprise prompt_storage (CAS) setting, with all other repositories
falling back to a configurable default mode.

Changes:
- Add PromptStorageMode enum with Default, Notes, Local variants
- Add include_prompts_in_repositories config option (glob patterns)
- Add default_prompt_storage fallback config option
- Add effective_prompt_storage() resolver function that:
  - First checks exclusion list (deny always wins → Local)
  - If no include list, uses legacy prompt_storage behavior
  - If include list exists, checks if repo matches patterns
- Update post_commit.rs to use the new resolver
- Add CLI support for get/set/unset of new config options
- Add comprehensive tests for the new functionality

Example configuration for work repos only using CAS:
{
  "prompt_storage": "default",
  "include_prompts_in_repositories": ["https://github.com/myorg/*"],
  "default_prompt_storage": "notes"
}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jwiegley jwiegley force-pushed the feature/include-prompts-in-repositories branch from c9c889d to 40d5af1 Compare January 28, 2026 18:45
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.

5 participants