Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/.vitepress/rfd-summaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
"summary": "Request-response linking via persistent event IDs detects answer scope under structural edits."
},
"101-conversation-labels.md": {
"hash": "8942119ffa726cd4f1b14a34dfc0cb46c34fdb4b7286276bdc238c2235fe1bfc",
"hash": "7be4cc00cbd33cb5cd8a4b96ce9f8838a7e6e059f3032c65fa640fce355f1e7a",
"summary": "Conversations gain configurable key-value labels—static, command-backed, or CLI-set—managed through `jp c label` and used to filter by context like VCS branches."
},
"100-in-repo-ticket-tracking.md": {
Expand All @@ -406,5 +406,9 @@
"099-native-macos-app-for-browsing-conversations.md": {
"hash": "abd96dc8025eb5c1021bc2077eddf2a1c483ac9833f2dd7eef2b0594b8b75290",
"summary": "Native macOS app for browsing JP conversations via FFI, with public Workspace::open API extracted from CLI."
},
"103-multi-value-conversation-labels.md": {
"hash": "26127fced8dac269abcc7b2368d8413846fd01f48889f6940cf15a4977f9c17f",
"summary": "Labels store sets of values per key with add/set/rm commands, multi-value filters, and configuration support."
}
}
48 changes: 34 additions & 14 deletions docs/rfd/101-conversation-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- **Category**: Design
- **Authors**: Jean Mertz <git@jeanmertz.com>
- **Date**: 2026-05-19
- **Extended by**: [RFD 103]

## Summary

Expand Down Expand Up @@ -79,6 +80,13 @@ conversation's effective config.
because their argument slot is already taken by the query text and the source
conversation:

> [!TIP]
> [RFD 103] removes `--label` and `--reset-labels` from both commands, leaving
> `jp c label` as the only way to mutate labels.
> Under a set-valued model the flag has to mean either "add to" or "replace",
> and nothing reads labels during a turn, so the two-command form loses nothing
> but a keystroke.

```sh
jp q --new --label=team=platform --label=branch=main
jp c fork <id> --label=stage=review
Expand Down Expand Up @@ -271,6 +279,12 @@ There is no back-propagation from metadata to config.

### Data model

> [!TIP]
> [RFD 103] replaces this with a set of values per key, so `crate=jp_config` and
> `crate=jp_llm` can coexist.
> Single-valued labels become the one-element case, and value order is
> preserved.

```rust
// jp_conversation::Conversation
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
Expand Down Expand Up @@ -309,28 +323,31 @@ pub struct ConversationConfig {

#[serde(untagged)]
pub enum LabelConfig {
/// Shorthand: `foo = "bar"` — a static label value with default
/// `apply_on` and `run`.
/// Shorthand: `foo = "bar"` — a static label value with default `apply_on`
/// and `run`.
Static(String),

/// Full form: `foo = { value, apply_on, run }`.
Object(LabelObject),
}

pub struct LabelObject {
/// The label's value: a literal string, or a command whose stdout
/// produces the value at resolution time.
/// The label's value: a literal string, or a command whose stdout produces
/// the value at resolution time.
#[setting(default = "")]
pub value: LabelValue,

/// When this label is auto-applied. Independent of CLI / alias use.
/// When this label is auto-applied.
/// Independent of CLI / alias use.
#[setting(default)]
pub apply_on: ApplyOn,

/// Confirmation policy for command-shaped values. Ignored for
/// `Static` values. Defaults to `Ask`. A label-specific enum;
/// conceptually similar to plugin `RunPolicy` (see [RFD 077]),
/// not shared with tool `RunMode` (which has different variants).
/// Confirmation policy for command-shaped values.
/// Ignored for `Static` values.
/// Defaults to `Ask`.
/// A label-specific enum; conceptually similar to plugin `RunPolicy` (see
/// [RFD 077]), not shared with tool `RunMode` (which has different
/// variants).
#[setting(default)]
pub run: LabelRunMode,
}
Expand All @@ -347,14 +364,16 @@ pub enum LabelValue {

#[derive(Default)]
pub struct ApplyOn {
/// Resolve and apply when a new conversation is created
/// (`jp q --new`). Default: `true`.
/// Resolve and apply when a new conversation is created (`jp q --new`).
/// Default: `true`.
#[setting(default = true)]
pub new: bool,

/// Re-resolve and apply when an existing conversation is forked
/// (`jp c fork`). Default: `false`. When `false`, the source
/// conversation's existing value (if any) is inherited verbatim.
/// Re-resolve and apply when an existing conversation is forked (`jp c
/// fork`).
/// Default: `false`.
/// When `false`, the source conversation's existing value (if any) is
/// inherited verbatim.
#[setting(default)]
pub fork: bool,
}
Expand Down Expand Up @@ -786,5 +805,6 @@ Mergeable independently of Phase 1, but depends on it.
[RFD 031]: 031-durable-conversation-storage-with-workspace-projection.md
[RFD 040]: 040-hidden-conversations-and-tool-context.md
[RFD 077]: 077-plugin-configuration-and-trust-policy.md
[RFD 103]: 103-multi-value-conversation-labels.md
[cmd-cfg]: ../architecture/ubiquitous-language.md#commandconfig
[tools]: ../../crates/jp_config/src/conversation/tool.rs
Loading
Loading