Skip to content

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

TypeScript

mods/telemetry: a Choice member may carry a hyphen, as the built-in panel's merge-base does

poteat1e6e5c750b7b
diff --git a/mods/telemetry/hooks/entries/checked-value/checked-value.ts b/mods/telemetry/hooks/entries/checked-value/checked-value.ts
index aa030e00..07fee1b0 100644
--- a/mods/telemetry/hooks/entries/checked-value/checked-value.ts
+++ b/mods/telemetry/hooks/entries/checked-value/checked-value.ts
@@ -60,7 +60,7 @@ export function checkedValue(
if (!isTokenList) {
throw refusal(
- `props.${key}.of: a list of 1 to ${CHOICES_LIMIT} ` + `snake_case tokens`,
+ `props.${key}.of: a list of 1 to ${CHOICES_LIMIT} ` + `lowercase tokens`,
method,
)
}
diff --git a/mods/telemetry/hooks/entries/choice-token/choice-token.ts b/mods/telemetry/hooks/entries/choice-token/choice-token.ts
index 29479224..e64eefb3 100644
--- a/mods/telemetry/hooks/entries/choice-token/choice-token.ts
+++ b/mods/telemetry/hooks/entries/choice-token/choice-token.ts
@@ -1,6 +1,7 @@
/**
- * The shape of a Choice member: a snake_case token of at most 64 characters,
- * which may start with a digit (a bucket such as `110_to_143`), unlike a name
- * or a key (TOKEN).
+ * The shape of a Choice member: a lowercase token of at most 64 characters,
+ * of letters, digits, `_` and `-`, which may start with a digit (a bucket
+ * such as `110_to_143`) and carry a hyphen (a kind such as `merge-base`),
+ * unlike a name or a key (TOKEN).
*/
-export const CHOICE_TOKEN = /^[a-z0-9][a-z0-9_]{0,63}$/
+export const CHOICE_TOKEN = /^[a-z0-9][a-z0-9_-]{0,63}$/
diff --git a/mods/telemetry/hooks/telemetry-types/choice/choice.ts b/mods/telemetry/hooks/telemetry-types/choice/choice.ts
index c6ae243d..62d215b7 100644
--- a/mods/telemetry/hooks/telemetry-types/choice/choice.ts
+++ b/mods/telemetry/hooks/telemetry-types/choice/choice.ts
@@ -2,7 +2,8 @@
* A string property: the value and the list it is chosen from, declared
* beside it, so no free text reaches the row.
*
- * Every member of `of` is a snake_case token, which may start with a digit,
- * at most CHOICES_LIMIT of them; `value` is one of them.
+ * Every member of `of` is a lowercase token of letters, digits, `_` and
+ * `-`, which may start with a digit, at most CHOICES_LIMIT of them; `value`
+ * is one of them.
*/
export type Choice = { value: string; of: readonly string[] }