From ed88733520ed5af3140c06b2840d577b5a3ca5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 13 Aug 2026 07:09:04 +0300 Subject: [PATCH] chore: rename ponytail: comment marker to corner-cut: Marker convention renamed after uninstalling the ponytail plugin; semantics unchanged (deliberate corner-cut, known ceiling + upgrade path). Token-only rename, 26 comment lines, no code change. --- .claude/kb-sync.sh | 2 +- src/constant.rs | 2 +- src/domain/appointment.rs | 2 +- src/domain/cap.rs | 4 ++-- src/domain/course.rs | 2 +- src/domain/exam_attempt.rs | 2 +- src/domain/homework_result.rs | 2 +- src/domain/menu.rs | 2 +- src/domain/payment_ledger.rs | 2 +- src/domain/session_attendance.rs | 4 ++-- src/main.rs | 2 +- src/migration_sql.rs | 2 +- src/rate_limit.rs | 4 ++-- src/web/appointments.rs | 2 +- src/web/board_ws.rs | 4 ++-- src/web/exam_ws.rs | 4 ++-- src/web/exams/mod.rs | 4 ++-- src/web/homework.rs | 2 +- tests/e2e.rs | 2 +- tests/integration.rs | 2 +- 20 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.claude/kb-sync.sh b/.claude/kb-sync.sh index 7551ca7..69c62f8 100755 --- a/.claude/kb-sync.sh +++ b/.claude/kb-sync.sh @@ -19,7 +19,7 @@ ingest() { } check() { - # ponytail: substring match on ".rs" anywhere in README — a module + # corner-cut: substring match on ".rs" anywhere in README — a module # mentioned outside ## Layout also counts; tighten to the section if it lies missing="" for f in src/domain/*.rs src/web/*.rs; do diff --git a/src/constant.rs b/src/constant.rs index 7cbbe76..a88547d 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -953,7 +953,7 @@ pub const USER_BOARD_COUNT_FIELD: &str = "board_count"; /// at zero, and absent means zero: an account older than the columns reads /// exactly like a fresh one. // -// ponytail: that cascade ruling is also the farm's long way round — delete the +// corner-cut: that cascade ruling is also the farm's long way round — delete the // *exam* instead of the mark and the credit stands, so the loop still climbs, // at a couple of requests a point rather than two. Closing it means // `Exam::delete`, `Homework::delete` and `Course::delete` refunding per swept diff --git a/src/domain/appointment.rs b/src/domain/appointment.rs index 70e667d..0c410a0 100644 --- a/src/domain/appointment.rs +++ b/src/domain/appointment.rs @@ -66,7 +66,7 @@ use crate::validate::validate_required; /// touch no roster, term, event seat, or exam room, and none of those touch /// appointments — so they cannot deadlock. Should a future path ever need two, /// take this one *last*. -// ponytail: global lock; per-teacher locks if appointment traffic ever grows +// corner-cut: global lock; per-teacher locks if appointment traffic ever grows // enough for the contention to matter. pub(crate) static APPOINTMENT_LOCK: Mutex<()> = Mutex::const_new(()); diff --git a/src/domain/cap.rs b/src/domain/cap.rs index 93d9101..06f23c8 100644 --- a/src/domain/cap.rs +++ b/src/domain/cap.rs @@ -21,7 +21,7 @@ //! zero, so no Rust struct carries them and no whole-row save can clobber one //! (every parent's `.content()` write is a create of a fresh row). // -// ponytail: a counter can only drift if a future delete path forgets its +// corner-cut: a counter can only drift if a future delete path forgets its // decrement, and the boot backfill seeds most counters once rather than // recomputing them. `enrollment_count` is the one that already drifted (the boot // sweep of promoted users' rows kept their seats), so it is recomputed on every @@ -52,7 +52,7 @@ use crate::error::AppError; /// 16-racer round had one more caller told it had won than the counter agreed /// to). The real ws server never did this in 150 rounds of the same probe. // -// ponytail: one lock for every cap. Per-parent locks (a keyed map) if unrelated +// corner-cut: one lock for every cap. Per-parent locks (a keyed map) if unrelated // caps ever contend measurably — the counters are already independent, this is // only about how many writes a process has in flight. static CLAIM_LOCK: Mutex<()> = Mutex::const_new(()); diff --git a/src/domain/course.rs b/src/domain/course.rs index a836877..dae9577 100644 --- a/src/domain/course.rs +++ b/src/domain/course.rs @@ -245,7 +245,7 @@ impl Course { /// The courses `user` runs — the ones they created plus the ones a manager /// assigned them to. A teacher's slice of the catalog. /// - /// ponytail: unpaged full table scan, and it stays one — every profile read + /// corner-cut: unpaged full table scan, and it stays one — every profile read /// of a teacher pays it, so the ceiling is the course table's size. It /// cannot be indexed away on SurrealDB 3.2.3: an index on `creator` alone /// leaves the `OR` a `TableScan` (EXPLAIN), and the per-element index the diff --git a/src/domain/exam_attempt.rs b/src/domain/exam_attempt.rs index b56bfb3..bba8d8f 100644 --- a/src/domain/exam_attempt.rs +++ b/src/domain/exam_attempt.rs @@ -424,7 +424,7 @@ impl ExamAttempt { /// `swap_remove`s errored slots, so a fixed slot read is meaningless once /// anything failed. // - // ponytail: the count and a concurrent `CREATE exam_attempt` are still not + // corner-cut: the count and a concurrent `CREATE exam_attempt` are still not // serialized against each other — SurrealDB does not conflict-check a // cross-record count (the write skew `domain::cap` exists for), so an // attempt landing in the same instant as an edit can still interleave diff --git a/src/domain/homework_result.rs b/src/domain/homework_result.rs index 48ab520..9354961 100644 --- a/src/domain/homework_result.rs +++ b/src/domain/homework_result.rs @@ -140,7 +140,7 @@ impl HomeworkResult { /// its own, and the two leases are mutually exclusive in the one process /// this backend runs as, so the interleaving never gets a window. // - // ponytail: that makes the freeze depend on lock discipline at the call + // corner-cut: that makes the freeze depend on lock discipline at the call // sites, not on this row. Moving a student write's lease to *after* its // database write — or sharding HOMEWORK_LOCK per homework — reopens the // window with nothing to catch it. Closing it in the domain layer needs a diff --git a/src/domain/menu.rs b/src/domain/menu.rs index 61c2268..d36489e 100644 --- a/src/domain/menu.rs +++ b/src/domain/menu.rs @@ -32,7 +32,7 @@ use crate::error::{AppError, ValidationError}; /// slot-removal guard: those went to conditional single-record writes /// ([`crate::domain::cap`]), which the store decides as this lock cannot. // -// ponytail: the dish cap therefore rests on this lock alone — a dish write +// corner-cut: the dish cap therefore rests on this lock alone — a dish write // added without taking it reopens the count-then-write hole silently. Closing // it properly is another `cap` counter (`dish_count` on the menu row) plus its // backfill; the ceiling is 51 dishes on a menu, not money or a seat, so it was diff --git a/src/domain/payment_ledger.rs b/src/domain/payment_ledger.rs index 5a2b082..b6d4828 100644 --- a/src/domain/payment_ledger.rs +++ b/src/domain/payment_ledger.rs @@ -582,7 +582,7 @@ impl PaymentLedger { /// recorded, so a line that is *already* over the ceiling (written before /// it existed) still reads, still refunds through its own children, and is /// still reversible. Only a fresh line applied to *it* is turned away. - // ponytail: one query per line, ceiling MAX_LEDGER_APPLIED_LINES; fold the + // corner-cut: one query per line, ceiling MAX_LEDGER_APPLIED_LINES; fold the // walk into one recursive statement if that ceiling ever has to rise. async fn applied_to(target: &PaymentLedger, db: &Database) -> Result { let mut total = 0i64; diff --git a/src/domain/session_attendance.rs b/src/domain/session_attendance.rs index 73818cf..3bead1b 100644 --- a/src/domain/session_attendance.rs +++ b/src/domain/session_attendance.rs @@ -178,7 +178,7 @@ impl SessionAttendance { /// Both are floored/guarded rather than trusting the column to exist: a row /// written before these columns carries none of them. // - // ponytail: that asymmetry leaves a teacher able to inflate a *student's* + // corner-cut: that asymmetry leaves a teacher able to inflate a *student's* // attendance with future-dated lessons. Closing it needs the credit stamped // on the roll-call row itself and refunded off that stamp — the same column // the live-role note on `remove` below wants, and the shape @@ -306,7 +306,7 @@ impl SessionAttendance { /// /// Sound to re-send: neither statement can answer "already exists". // - // ponytail: both ends read the *live* role, so a student promoted between + // corner-cut: both ends read the *live* role, so a student promoted between // being marked present and having that row corrected leaves the counter one // high (the credit landed as a student, the refund is refused as staff). // Upgrade path is stamping the credit on the roll-call row itself and diff --git a/src/main.rs b/src/main.rs index 88e1145..dd9dd19 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,7 +73,7 @@ fn keepalive(db: Database, health: DbHealth) { std::time::Duration::from_secs(hezarfen_backend::constant::DB_PING_TIMEOUT_SECS); loop { interval.tick().await; - // ponytail: an abandoned ping stays queued in the SDK and replays + // corner-cut: an abandoned ping stays queued in the SDK and replays // when the socket heals, so a long outage lands a burst of no-op // `RETURN 1`s on recovery. Harmless; probe over a raw TCP dial // instead if that burst ever shows up in a profile. diff --git a/src/migration_sql.rs b/src/migration_sql.rs index 8c94b67..ec59cd9 100644 --- a/src/migration_sql.rs +++ b/src/migration_sql.rs @@ -1379,7 +1379,7 @@ pub const BACKFILL: &str = " -- withdrawal exactly what the seed credited it. Absolute like every SET -- below, so it converges on a forced re-seed. -- - -- ponytail: editing this block re-runs it (the fingerprint gate), and unlike + -- corner-cut: editing this block re-runs it (the fingerprint gate), and unlike -- the board sweep above this one is only *mostly* re-runnable. Every SET is -- absolute, so a re-run converges on the rows that exist — but two of the -- counters are lifetime tallies the request path never decrements while the diff --git a/src/rate_limit.rs b/src/rate_limit.rs index 484d30d..cd19885 100644 --- a/src/rate_limit.rs +++ b/src/rate_limit.rs @@ -290,7 +290,7 @@ impl RateLimiter { // Only a *new* key can grow the map, so only a new key pays for a sweep // — a client already in there stays one hash lookup, saturated or not. - // ponytail: while the map is saturated every new key still pays one + // corner-cut: while the map is saturated every new key still pays one // O(n) scan. Ceiling: it takes 10k live exhausted clients to get there // and the scan is the attacker's own request. Upgrade path: keep the // earliest `window_start` beside the map and skip the scan until then. @@ -495,7 +495,7 @@ async fn sync_once( // before it began. Only a bucket that has never synced owes // its whole count, having been billed nowhere yet. // - // ponytail: admits between the boundary and this round land + // corner-cut: admits between the boundary and this round land // on the old row. Ceiling: RATE_SYNC_INTERVAL_SECS of one // client's traffic, charged once either way. Upgrade path: // stamp each admit with its epoch. diff --git a/src/web/appointments.rs b/src/web/appointments.rs index a492f2a..698824f 100644 --- a/src/web/appointments.rs +++ b/src/web/appointments.rs @@ -373,7 +373,7 @@ async fn publish_slots( /// people who published bookable time. Same for the `teacher` / `proposed_by` / /// `decided_by` refs on a booking. Pinned by /// `tests/regress_appointments.rs::a_parent_reads_the_slot_teachers_identity`. -// ponytail: occupancy would be one query per slot with today's domain API; a +// corner-cut: occupancy would be one query per slot with today's domain API; a // batch "live bookings for these slots" read would let the list carry it. #[utoipa::path( get, diff --git a/src/web/board_ws.rs b/src/web/board_ws.rs index 8b31d11..3b275f0 100644 --- a/src/web/board_ws.rs +++ b/src/web/board_ws.rs @@ -267,7 +267,7 @@ async fn forward( // it published them: only the head can match, which keeps the check O(1) // and cannot swallow someone else's mark that happens to be next. // - // ponytail: that ordering is an unenforced coupling — the head only ever + // corner-cut: that ordering is an unenforced coupling — the head only ever // matches because `mine.push_back` immediately precedes `publish` in // `handle_message`, on a loop that is single-threaded per socket. Separate // those two lines (or publish from anywhere else) and this socket starts @@ -289,7 +289,7 @@ async fn forward( // tick noticed. Re-derived against the database, never read off the frame: // the frame is the prompt, the row is the authority. // - // ponytail: that is one `live_board` (two reads) per forwarded frame, paid + // corner-cut: that is one `live_board` (two reads) per forwarded frame, paid // by every listening socket, where the fan-out used to be read-free — a // busy board now multiplies its database traffic by the size of the room. // The drawer's own echo is dropped above without paying it, which is the diff --git a/src/web/exam_ws.rs b/src/web/exam_ws.rs index 2a8e6ee..91afd32 100644 --- a/src/web/exam_ws.rs +++ b/src/web/exam_ws.rs @@ -95,7 +95,7 @@ const ROOM: &str = "exam room"; /// refused). The count this pairs with lives in *this* process's memory /// ([`crate::state::ExamPresence`]), so process-wide is exactly the right /// scope: there is no room state anywhere else to serialize against. -// ponytail: global lock, per-attempt locks if room churn ever shows up in a +// corner-cut: global lock, per-attempt locks if room churn ever shows up in a // profile. static PRESENCE_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(()); @@ -386,7 +386,7 @@ async fn handle_message( // like `save_answer_checked` — and dropped before the socket // sends, so a slow client never stalls a writer. // - // ponytail (accepted race, reviewed): the room's sitting was + // corner-cut (accepted race, reviewed): the room's sitting was // chosen at join, before any lease, so no lock scope can help — a // save can land on it just after a retake made it terminal. It // writes a history row for the old seq; the grade of record (latest diff --git a/src/web/exams/mod.rs b/src/web/exams/mod.rs index 69064e9..cd022a3 100644 --- a/src/web/exams/mod.rs +++ b/src/web/exams/mod.rs @@ -96,7 +96,7 @@ impl Scheduled for Exam { /// the subject's own reference counter /// ([`crate::domain::subject::Subject::delete`]), which every question create, /// re-tag and delete moves. -// ponytail: global RwLock, shard per-exam if save latency ever matters. +// corner-cut: global RwLock, shard per-exam if save latency ever matters. pub(crate) static EXAM_LOCK: tokio::sync::RwLock<()> = tokio::sync::RwLock::const_new(()); pub fn routes() -> OpenApiRouter { @@ -605,7 +605,7 @@ async fn delete_exam( // an image row written after that snapshot would strand its bytes on disk // even though the row itself is now refused. // - // ponytail: process-local, so it holds because the deployment is a single + // corner-cut: process-local, so it holds because the deployment is a single // replica with stop-the-world deploys (two overlapping binaries would // reopen it). Closing it in the store means the `cap` shape the counter // work already sketched: `claim_and_create` gaining a second record to diff --git a/src/web/homework.rs b/src/web/homework.rs index 7bc580e..125ee7d 100644 --- a/src/web/homework.rs +++ b/src/web/homework.rs @@ -78,7 +78,7 @@ use super::{ /// /// Lock order, where both are taken: `HOMEWORK_LOCK` before the counter lock in /// [`crate::domain::cap`], never the reverse. -// ponytail: global RwLock, shard per-homework if write latency ever matters. +// corner-cut: global RwLock, shard per-homework if write latency ever matters. pub(crate) static HOMEWORK_LOCK: tokio::sync::RwLock<()> = tokio::sync::RwLock::const_new(()); pub fn routes() -> OpenApiRouter { diff --git a/tests/e2e.rs b/tests/e2e.rs index e5c3019..4a98221 100644 --- a/tests/e2e.rs +++ b/tests/e2e.rs @@ -2468,7 +2468,7 @@ async fn a_lagged_socket_resyncs_to_exactly_what_the_database_holds() { // between the two ends swallowed ~1200 frames on this machine before the // room's writer stalled, and only then does the 256-frame channel start // dropping — so the count carries roughly 2x the measured margin. - // ponytail: a host with `net.ipv4.tcp_wmem` tuned far past the 4 MB + // corner-cut: a host with `net.ipv4.tcp_wmem` tuned far past the 4 MB // default could buffer more than this and the lag would stop being // forced; the test would then pass vacuously up to the resync assert, // which fails loudly rather than silently. diff --git a/tests/integration.rs b/tests/integration.rs index e92c951..2dae8b8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -5192,7 +5192,7 @@ async fn admin_manages_roles_with_guards() { /// The only other `create_with_role` caller is the out-of-band admin bootstrap /// (`src/domain/user.rs:426`, hardcoded `Role::Admin`, behind no route). /// -/// ponytail: that funnel list is grep-verified, not machine-enforced — a *new* +/// corner-cut: that funnel list is grep-verified, not machine-enforced — a *new* /// route writing an arbitrary role string would slip past this test. Upgrade /// path: derive the surface list from the emitted OpenAPI, the way the auth-gate /// test derives its protected-path set.