From e5478d98907edd97f8a268cff891765e69e71309 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Tue, 29 Sep 2026 09:28:12 -0400 Subject: [PATCH] refactor(names)!: rename counter_encoding to number_encoding The setting writes the {t} timestamp as well as the {n} counter, so the `[names]` key, the `--number-encoding` flag and the `NumberEncoding` type are named for any number in a label. Co-Authored-By: Claude Opus 5.5 Change-Id: I8181a0ef9628179297edb3dab63cb4c59a875a4b --- crates/didbot-config/src/lib.rs | 2 +- crates/didbot-config/src/sections.rs | 4 +- crates/didbot-name/src/fragments.rs | 8 +-- crates/didbot-name/src/generated.rs | 34 ++++++------- crates/didbot-name/src/lib.rs | 2 +- crates/didbot-name/src/tests.rs | 50 +++++++++---------- .../didbot-serve/src/bin/didbot-pds/config.rs | 8 +-- .../src/bin/didbot-pds/config_tests.rs | 8 +-- .../didbot-serve/src/bin/didbot-pds/main.rs | 18 +++---- .../didbot-serve/src/bin/didbot-pds/naming.rs | 4 +- docs/running-locally.md | 2 +- plan/config.md | 6 +-- plan/zone-scale.md | 6 +-- 13 files changed, 76 insertions(+), 76 deletions(-) diff --git a/crates/didbot-config/src/lib.rs b/crates/didbot-config/src/lib.rs index c4f3139c..b09175c8 100644 --- a/crates/didbot-config/src/lib.rs +++ b/crates/didbot-config/src/lib.rs @@ -126,7 +126,7 @@ pub struct Config { /// `[capacity]` — how many accounts this deployment may hold. #[serde(default)] pub capacity: Option, - /// `[names]` — the naming spec, its fallback, the counter encoding + /// `[names]` — the naming spec, its fallback, the number encoding /// and the hold period. #[serde(default)] pub names: Option, diff --git a/crates/didbot-config/src/sections.rs b/crates/didbot-config/src/sections.rs index be01a7f7..41adb9d4 100644 --- a/crates/didbot-config/src/sections.rs +++ b/crates/didbot-config/src/sections.rs @@ -257,7 +257,7 @@ pub struct NamesSection { pub fallback: Option, /// How a number is written into a label: the `n` and `t` slots, and /// the `counter` and `timestamp` namings. Mirrors - /// `--counter-encoding`. One key rather than one per number, because + /// `--number-encoding`. One key rather than one per number, because /// a label carrying a count and a time should read in one number /// system rather than two. /// @@ -269,7 +269,7 @@ pub struct NamesSection { /// template already spends most of a DNS label on words, gets shorter /// names from it. Both are legal in a label at every count, so the /// choice is about length and readability rather than validity. - pub counter_encoding: Option, + pub number_encoding: Option, /// Days a released name stays held before it can be taken again. /// Mirrors `--name-hold`. /// diff --git a/crates/didbot-name/src/fragments.rs b/crates/didbot-name/src/fragments.rs index 8be9a851..398d25dd 100644 --- a/crates/didbot-name/src/fragments.rs +++ b/crates/didbot-name/src/fragments.rs @@ -21,7 +21,7 @@ use std::sync::Arc; use serde::Deserialize; -use crate::generated::{unix_seconds, CounterEncoding, CounterSource}; +use crate::generated::{unix_seconds, CounterSource, NumberEncoding}; use crate::{check, tidy, NameError, Namer, Seed}; /// The slot that draws from the deployment's monotonic counter rather than @@ -150,7 +150,7 @@ pub struct Fragments { lists: BTreeMap>, deterministic: bool, counter: Option>, - encoding: CounterEncoding, + encoding: NumberEncoding, } /// The file shape: a template and a table of lists. @@ -219,7 +219,7 @@ impl Fragments { lists, deterministic, counter: None, - encoding: CounterEncoding::default(), + encoding: NumberEncoding::default(), }) } @@ -237,7 +237,7 @@ impl Fragments { /// Writes the counter and time slots in `encoding` instead of decimal. #[must_use] - pub fn with_encoding(mut self, encoding: CounterEncoding) -> Self { + pub fn with_encoding(mut self, encoding: NumberEncoding) -> Self { self.encoding = encoding; self } diff --git a/crates/didbot-name/src/generated.rs b/crates/didbot-name/src/generated.rs index 281a51c3..0e5c43e1 100644 --- a/crates/didbot-name/src/generated.rs +++ b/crates/didbot-name/src/generated.rs @@ -65,14 +65,14 @@ pub trait CounterSource: Send + Sync + fmt::Debug { fn next(&self) -> Result; } -/// How a counter's value is written into a label. +/// How a number — a counter's value or a timestamp — is written into a label. /// /// Both spellings are lowercase digits and letters at every value, so a label /// carrying one is legal wherever a label carrying the other is. They differ /// in length and in what a person reads back: decimal is the number itself, /// base32 is shorter once the count passes a million. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub enum CounterEncoding { +pub enum NumberEncoding { /// Decimal digits, no padding: `0`, `4813`, `18446744073709551615`. The /// count as anyone would write it, and 20 characters at its longest. #[default] @@ -84,7 +84,7 @@ pub enum CounterEncoding { Base32, } -impl CounterEncoding { +impl NumberEncoding { /// The label text for `value`. pub fn render(self, value: u64) -> String { match self { @@ -112,13 +112,13 @@ impl CounterEncoding { } } -impl fmt::Display for CounterEncoding { +impl fmt::Display for NumberEncoding { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.spelling()) } } -impl std::str::FromStr for CounterEncoding { +impl std::str::FromStr for NumberEncoding { type Err = NameError; fn from_str(raw: &str) -> Result { @@ -126,7 +126,7 @@ impl std::str::FromStr for CounterEncoding { "decimal" => Ok(Self::Decimal), "base32" => Ok(Self::Base32), other => Err(NameError::Misconfigured(format!( - "{other:?} is not a counter encoding; write `decimal` or `base32`" + "{other:?} is not a number encoding; write `decimal` or `base32`" ))), } } @@ -152,13 +152,13 @@ impl std::str::FromStr for CounterEncoding { /// a word list, [`Uuid`], or [`Random`] instead. /// /// [`fragments::Fragments`](crate::fragments::Fragments)'s `{n}` slot draws -/// from the same source and writes it with the same [`CounterEncoding`], so a +/// from the same source and writes it with the same [`NumberEncoding`], so a /// deployment can have a word and a count in one label. #[derive(Debug, Clone)] pub struct Counter { source: Arc, prefix: String, - encoding: CounterEncoding, + encoding: NumberEncoding, } impl Counter { @@ -167,7 +167,7 @@ impl Counter { Self { source, prefix: "agent-".to_owned(), - encoding: CounterEncoding::default(), + encoding: NumberEncoding::default(), } } @@ -184,7 +184,7 @@ impl Counter { /// Writes the count in `encoding` instead of decimal. #[must_use] - pub fn with_encoding(mut self, encoding: CounterEncoding) -> Self { + pub fn with_encoding(mut self, encoding: NumberEncoding) -> Self { self.encoding = encoding; self } @@ -246,11 +246,11 @@ pub fn unix_seconds() -> u64 { /// hostnames publicly is publishing its provisioning timeline alongside them. /// /// [`fragments::Fragments`](crate::fragments::Fragments)'s `{t}` slot reads -/// the same clock and writes it with the same [`CounterEncoding`], so a +/// the same clock and writes it with the same [`NumberEncoding`], so a /// deployment can have a word and a time in one label. #[derive(Debug, Clone, Copy, Default)] pub struct Timestamp { - encoding: CounterEncoding, + encoding: NumberEncoding, } impl Timestamp { @@ -261,7 +261,7 @@ impl Timestamp { /// Writes the seconds in `encoding` instead of decimal. #[must_use] - pub fn with_encoding(mut self, encoding: CounterEncoding) -> Self { + pub fn with_encoding(mut self, encoding: NumberEncoding) -> Self { self.encoding = encoding; self } @@ -539,7 +539,7 @@ mod tests { #[test] fn a_counter_never_repeats_and_always_mints() { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { let counter = Counter::new(Arc::new(TestSource(AtomicU64::new(0)))).with_encoding(encoding); let mut seen = std::collections::HashSet::new(); @@ -561,7 +561,7 @@ mod tests { /// has stopped producing legal labels. #[test] fn a_counter_at_its_last_value_still_mints() { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { let counter = Counter::new(Arc::new(TestSource(AtomicU64::new(u64::MAX)))) .with_encoding(encoding); let name = counter @@ -584,7 +584,7 @@ mod tests { #[test] fn timestamps_mint_and_vary_with_the_attempt() { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { for attempt in [0u32, 1, 2, 15] { let seed = Seed { attempt, @@ -610,7 +610,7 @@ mod tests { fn a_timestamp_label_is_legal_at_the_far_end_of_the_clock() { // 2100-01-01T00:00:00Z, and the end of the range itself. for seconds in [4_102_444_800u64, u64::MAX] { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { for attempt in [0u32, 15] { let name = tidy( &Timestamp::new() diff --git a/crates/didbot-name/src/lib.rs b/crates/didbot-name/src/lib.rs index ad05fb8e..8c157d9d 100644 --- a/crates/didbot-name/src/lib.rs +++ b/crates/didbot-name/src/lib.rs @@ -34,7 +34,7 @@ use std::fmt; pub use command::CommandNamer; pub use fragments::{Fragments, Template, COUNTER_SLOT, RESERVED_SLOTS, TIME_SLOT}; -pub use generated::{Alphabet, Counter, CounterEncoding, CounterSource, Random, Timestamp, Uuid}; +pub use generated::{Alphabet, Counter, CounterSource, NumberEncoding, Random, Timestamp, Uuid}; pub use lists::{bundled, bundled_names, from_spec, BUNDLED, DEFAULT_SPEC}; /// The longest a name can be, because a DNS label is 63 octets. diff --git a/crates/didbot-name/src/tests.rs b/crates/didbot-name/src/tests.rs index a67e2d34..c5fd0711 100644 --- a/crates/didbot-name/src/tests.rs +++ b/crates/didbot-name/src/tests.rs @@ -431,7 +431,7 @@ fn no_bundled_list_holds_a_word_and_its_plural() { // The counter slot // --------------------------------------------------------------------------- -use crate::generated::{CounterEncoding, CounterSource}; +use crate::generated::{CounterSource, NumberEncoding}; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; @@ -451,7 +451,7 @@ impl CounterSource for TestCounter { } } -fn counting(encoding: CounterEncoding) -> Fragments { +fn counting(encoding: NumberEncoding) -> Fragments { Fragments::new("{stone}-{creature}-{n}", lists(), true) .expect("a template may name the counter slot") .with_counter(TestCounter::at(0)) @@ -462,7 +462,7 @@ fn counting(encoding: CounterEncoding) -> Fragments { /// A hundred names out of a twelve-name pair, none repeated, none retried. #[test] fn a_counting_template_issues_a_hundred_names_with_no_retry_and_no_repeat() { - let namer = counting(CounterEncoding::default()); + let namer = counting(NumberEncoding::default()); assert_eq!(namer.max_useful_attempts(), Some(1)); assert_eq!(namer.capacity(), usize::MAX); @@ -483,7 +483,7 @@ fn a_counting_template_issues_a_hundred_names_with_no_retry_and_no_repeat() { /// count has reached, in either encoding. #[test] fn a_counted_label_is_legal_at_the_last_value_the_counter_can_reach() { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { let namer = Fragments::new("{stone}-{creature}-{n}", lists(), true) .expect("a template") .with_counter(TestCounter::at(u64::MAX)) @@ -501,32 +501,32 @@ fn a_counted_label_is_legal_at_the_last_value_the_counter_can_reach() { #[test] fn an_encoding_renders_the_ends_of_the_range() { - assert_eq!(CounterEncoding::Decimal.render(0), "0"); + assert_eq!(NumberEncoding::Decimal.render(0), "0"); assert_eq!( - CounterEncoding::Decimal.render(u64::MAX), + NumberEncoding::Decimal.render(u64::MAX), u64::MAX.to_string() ); - assert_eq!(CounterEncoding::Base32.render(0), "0"); - assert_eq!(CounterEncoding::Base32.render(31), "z"); - assert_eq!(CounterEncoding::Base32.render(32), "10"); - assert_eq!(CounterEncoding::Base32.render(u64::MAX), "fzzzzzzzzzzzz"); + assert_eq!(NumberEncoding::Base32.render(0), "0"); + assert_eq!(NumberEncoding::Base32.render(31), "z"); + assert_eq!(NumberEncoding::Base32.render(32), "10"); + assert_eq!(NumberEncoding::Base32.render(u64::MAX), "fzzzzzzzzzzzz"); // Crockford leaves these four out, so nothing in a label is read back as // a digit and no label spells a word. for excluded in ['i', 'l', 'o', 'u'] { for value in [0u64, 1, 18, 19, 20, 24, 30, 31, 12_345_678, u64::MAX] { - let rendered = CounterEncoding::Base32.render(value); + let rendered = NumberEncoding::Base32.render(value); assert!(!rendered.contains(excluded), "{rendered:?} has {excluded}"); } } assert_eq!( - "decimal".parse::().expect("legal"), - CounterEncoding::Decimal + "decimal".parse::().expect("legal"), + NumberEncoding::Decimal ); assert_eq!( - "base32".parse::().expect("legal"), - CounterEncoding::Base32 + "base32".parse::().expect("legal"), + NumberEncoding::Base32 ); - assert!("hex".parse::().is_err()); + assert!("hex".parse::().is_err()); } /// Two counter values in one name are two unrelated numbers and twice the @@ -565,7 +565,7 @@ fn a_counting_template_with_no_counter_attached_says_so() { /// the count, because that is what it costs. #[test] fn a_counting_template_describes_what_it_discloses() { - let described = counting(CounterEncoding::Base32).describe(); + let described = counting(NumberEncoding::Base32).describe(); assert!(described.contains("counter"), "{described}"); assert!(described.contains("base32"), "{described}"); assert!(described.contains("discloses"), "{described}"); @@ -599,10 +599,10 @@ use crate::TIME_SLOT; /// Reads the number back out of a label, independently of the code that /// wrote it: the alphabet is spelled out here, so a test can only pass by /// agreeing with what the encoding actually emitted. -fn number_in(text: &str, encoding: CounterEncoding) -> u64 { +fn number_in(text: &str, encoding: NumberEncoding) -> u64 { let alphabet: &str = match encoding { - CounterEncoding::Decimal => "0123456789", - CounterEncoding::Base32 => "0123456789abcdefghjkmnpqrstvwxyz", + NumberEncoding::Decimal => "0123456789", + NumberEncoding::Base32 => "0123456789abcdefghjkmnpqrstvwxyz", }; let base = alphabet.len() as u64; text.chars().fold(0u64, |value, ch| { @@ -613,7 +613,7 @@ fn number_in(text: &str, encoding: CounterEncoding) -> u64 { }) } -fn stamping(encoding: CounterEncoding) -> Fragments { +fn stamping(encoding: NumberEncoding) -> Fragments { Fragments::new("{stone}-{creature}-{t}", lists(), true) .expect("a template may name the time slot") .with_encoding(encoding) @@ -623,7 +623,7 @@ fn stamping(encoding: CounterEncoding) -> Fragments { /// reader can get the time back out of it. #[test] fn a_stamped_name_reads_back_as_the_time_it_was_minted() { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { let before = unix_seconds(); let name = stamping(encoding) .suggest(&Seed::new("token-a", "agents.example")) @@ -675,7 +675,7 @@ fn two_names_in_one_second_differ_when_the_counter_is_there_too() { // Without the counter the same second gives the same name back, which is // why that template keeps the ordinary retry budget and numbers from the // first retry. - let clock_only = stamping(CounterEncoding::default()); + let clock_only = stamping(NumberEncoding::default()); assert_eq!(clock_only.max_useful_attempts(), None); assert_eq!( clock_only.assemble(&seed, at).expect("a name"), @@ -693,7 +693,7 @@ fn two_names_in_one_second_differ_when_the_counter_is_there_too() { fn a_stamped_label_is_legal_at_the_far_end_of_the_clock() { // 2100-01-01T00:00:00Z, and the last second a `u64` can hold. for seconds in [4_102_444_800u64, u64::MAX] { - for encoding in [CounterEncoding::Decimal, CounterEncoding::Base32] { + for encoding in [NumberEncoding::Decimal, NumberEncoding::Base32] { let namer = stamping(encoding); for attempt in [0u32, 1, 15] { let seed = Seed { @@ -754,7 +754,7 @@ fn a_spec_takes_the_clock_as_a_part() { /// the minting time, because that is what it costs. #[test] fn a_stamping_template_describes_what_it_discloses() { - let described = stamping(CounterEncoding::Base32).describe(); + let described = stamping(NumberEncoding::Base32).describe(); assert!(described.contains("clock"), "{described}"); assert!(described.contains("base32"), "{described}"); assert!(described.contains("minted, to the second"), "{described}"); diff --git a/crates/didbot-serve/src/bin/didbot-pds/config.rs b/crates/didbot-serve/src/bin/didbot-pds/config.rs index 41c392d7..b3335771 100644 --- a/crates/didbot-serve/src/bin/didbot-pds/config.rs +++ b/crates/didbot-serve/src/bin/didbot-pds/config.rs @@ -141,11 +141,11 @@ pub(crate) fn apply_parsed_config( args.fallback_from_file = true; } } - if args.counter_encoding.is_none() { - if let Some(raw) = names.counter_encoding.as_deref() { - args.counter_encoding = Some( + if args.number_encoding.is_none() { + if let Some(raw) = names.number_encoding.as_deref() { + args.number_encoding = Some( raw.parse() - .map_err(|err| format!("[names] counter_encoding: {err}"))?, + .map_err(|err| format!("[names] number_encoding: {err}"))?, ); } } diff --git a/crates/didbot-serve/src/bin/didbot-pds/config_tests.rs b/crates/didbot-serve/src/bin/didbot-pds/config_tests.rs index 03701a6c..fb66b618 100644 --- a/crates/didbot-serve/src/bin/didbot-pds/config_tests.rs +++ b/crates/didbot-serve/src/bin/didbot-pds/config_tests.rs @@ -383,14 +383,14 @@ fn a_counting_spec_and_its_encoding_reach_the_namer() { let dir = TempDir::new("counting-names"); let path = dir.write( "didbot.toml", - "[names]\nspec = \"mineral+n\"\ncounter_encoding = \"base32\"\n", + "[names]\nspec = \"mineral+n\"\nnumber_encoding = \"base32\"\n", ); let config = load_config(Some(&path)).unwrap(); let mut args = Args::default(); apply_parsed_config(&mut args, config.as_ref()).unwrap(); assert_eq!( - args.counter_encoding, - Some(didbot_name::CounterEncoding::Base32) + args.number_encoding, + Some(didbot_name::NumberEncoding::Base32) ); let naming = build_naming(&args, None) @@ -432,7 +432,7 @@ fn a_stamping_spec_and_its_encoding_reach_the_namer() { let dir = TempDir::new("stamping-names"); let path = dir.write( "didbot.toml", - "[names]\nspec = \"mineral+t+n\"\ncounter_encoding = \"base32\"\n", + "[names]\nspec = \"mineral+t+n\"\nnumber_encoding = \"base32\"\n", ); let config = load_config(Some(&path)).unwrap(); let mut args = Args::default(); diff --git a/crates/didbot-serve/src/bin/didbot-pds/main.rs b/crates/didbot-serve/src/bin/didbot-pds/main.rs index 42f137eb..26d2c65c 100644 --- a/crates/didbot-serve/src/bin/didbot-pds/main.rs +++ b/crates/didbot-serve/src/bin/didbot-pds/main.rs @@ -154,9 +154,9 @@ struct Args { /// it under instead of the flag they did not use. names_from_file: bool, fallback_from_file: bool, - /// How the counter's value is written into a label, from - /// `--counter-encoding` or `[names] counter_encoding`. - counter_encoding: Option, + /// How a number in a label is written, from + /// `--number-encoding` or `[names] number_encoding`. + number_encoding: Option, /// How long a released name is held, in days. hold: Option, /// A byte budget for the write-ahead log, past which writes are refused. @@ -395,8 +395,8 @@ usage: didbot-pds [options] adding to it. [names] takes spec and fallback, in the spellings --names - and --names-if-down take, counter_encoding, in the - spellings --counter-encoding takes, and hold_days: 1 to + and --names-if-down take, number_encoding, in the + spellings --number-encoding takes, and hold_days: 1 to 365, how long a released name stays taken (default 30). A day covers whatever still has the name cached; a year suits a @@ -551,7 +551,7 @@ usage: didbot-pds [options] answer, in the same forms as --names. Off unless asked for: a deployment whose namer has been broken for a week should not look like one whose namer works. - --counter-encoding + --number-encoding how a number in a label is written -- the counter, the clock, and both generated forms: `decimal` (the default) or `base32`, lowercase Crockford, which fits the whole @@ -692,11 +692,11 @@ fn parse_args>(mut args: I) -> Result { let raw = value()?; parsed.fallback = Some(parse_naming(&raw)?); } - "--counter-encoding" => { + "--number-encoding" => { let raw = value()?; - parsed.counter_encoding = Some( + parsed.number_encoding = Some( raw.parse() - .map_err(|err| format!("--counter-encoding: {err}"))?, + .map_err(|err| format!("--number-encoding: {err}"))?, ); } "--name-hold" => { diff --git a/crates/didbot-serve/src/bin/didbot-pds/naming.rs b/crates/didbot-serve/src/bin/didbot-pds/naming.rs index 30c64307..53bb84a8 100644 --- a/crates/didbot-serve/src/bin/didbot-pds/naming.rs +++ b/crates/didbot-serve/src/bin/didbot-pds/naming.rs @@ -95,7 +95,7 @@ pub(crate) fn build_naming( // shared between `--names` and `--names-if-down`, so a fallback pair that // both mention `counter` draws from one sequence rather than two. let counter = durable.map(Durable::counter); - let encoding = args.counter_encoding.unwrap_or_default(); + let encoding = args.number_encoding.unwrap_or_default(); let names = args.names.clone().unwrap_or_default(); let names_source = if args.names_from_file { "[names] spec" @@ -145,7 +145,7 @@ pub(crate) fn build_namer( names: &Names, flag: &str, counter: Option<&Arc>, - encoding: didbot_name::CounterEncoding, + encoding: didbot_name::NumberEncoding, ) -> Result>, String> { use didbot_name::generated::{Counter as CounterNamer, Random, Timestamp, Uuid}; diff --git a/docs/running-locally.md b/docs/running-locally.md index 53543a3b..fb629359 100644 --- a/docs/running-locally.md +++ b/docs/running-locally.md @@ -131,7 +131,7 @@ in one second carries the same stamp, so a spec with `t` and no `n` still retries against the word lists; `mineral+creature+t+n` carries both and never repeats. A spec may name `t` once. -`--counter-encoding base32` writes both numbers in lowercase Crockford base32 +`--number-encoding base32` writes both numbers in lowercase Crockford base32 instead of decimal — `fzzzzzzzzzzzz` rather than `18446744073709551615` — which is worth it once they are long enough to crowd the rest of the label. One setting for both, so a label carrying a count and a time reads in one diff --git a/plan/config.md b/plan/config.md index 429e7b2c..26ae680f 100644 --- a/plan/config.md +++ b/plan/config.md @@ -80,8 +80,8 @@ and from `didbot-serve/src/routes/mod.rs`'s constants rather than guessed: volume, attributed writes grow with real use. Wired, with no flag mirroring either yet. - **`[names]`** — the naming spec or template, the fallback namer, the - counter encoding, the hold period. Wired, against `--names`, - `--names-if-down`, `--counter-encoding` and `--name-hold`. A spec that will + number encoding, the hold period. Wired, against `--names`, + `--names-if-down`, `--number-encoding` and `--name-hold`. A spec that will not build names the tier it was written in. - **`[limits]`** — rate limits and their windows, once `didbot-serve/src/rate_limit.rs` and `oauth/rate_limit.rs` converge on one @@ -231,7 +231,7 @@ pass: - [x] **A parameter an operator should be choosing has a key, and one they should not says why in its own doc.** `[capacity] log_budget_bytes`, `[tree] max_depth`, `[operator] grace_window_hours`, - `[credential] agent_token_ttl_days`, `[names] counter_encoding` and + `[credential] agent_token_ttl_days`, `[names] number_encoding` and the four `[intervals]` keys are the first half. The second is written beside the constants: `row_log` and `wal`'s segment sizes are the granularity a configured retention or budget is reclaimed in, `wal::DEFAULT_SYNC_INTERVAL` diff --git a/plan/zone-scale.md b/plan/zone-scale.md index f4a98bdb..9b76da12 100644 --- a/plan/zone-scale.md +++ b/plan/zone-scale.md @@ -100,8 +100,8 @@ down: the fix is cheap and knowing when to apply it is not free. the order. `n` on its own is the `counter` naming rather than a second namer beside it. One `DurableCounter` feeds every template a deployment configures, including `--names-if-down`'s, so changing the - spec keeps counting. `[names] counter_encoding` and - `--counter-encoding` write the count decimal (the default) or in + spec keeps counting. `[names] number_encoding` and + `--number-encoding` write the count decimal (the default) or in lowercase Crockford base32, which fits `u64::MAX` in thirteen characters instead of twenty. @@ -114,7 +114,7 @@ down: the fix is cheap and knowing when to apply it is not free. one second carries the same stamp, so a template with `{t}` and no `{n}` keeps the ordinary retry budget and numbers from the first retry the way `Timestamp` does; with `{n}` beside it the template - reports one useful attempt as before. `counter_encoding` governs both + reports one useful attempt as before. `number_encoding` governs both numbers, so a label carrying a count and a time reads in one number system rather than two. -- 2.54.0