Skip to content

Commit 9cd4bbf

Browse files
committed
docs: correct comments that name symbols which no longer exist
Each of these points a reader at an identifier that is not in the repo: - table/import-data.ts, table/service.ts — `acquireTablePositionLock` and `nextAutoPosition` were removed with the service.ts split; the surviving lock is `acquireRowOrderLock`, which import-data.ts already imports and calls. service.ts's mention is load-bearing: it exists to tell the reader which other lock this one mirrors, for lock-ordering. - resources/orchestration/restore-resource.ts — named `performRestoreFolder` (the callee is `restoreFolder`) and described a `'workflow'` default it falls back to. There is no such default: resourceType is required and the config lookup is a bare index. Describing a fiction is how a future reader talks themselves into relaxing the total Record to a Partial. - knowledge/search/queries.ts — cited apps/docs/app/api/chat/route.ts, deleted with Ask AI. The k=60 it pins against now lives in the docs search route. - rate-limiter/hosted-key/queue.ts — documented a `waitForHead` method the class does not have; the queue exposes `checkHead` and the polling loop is private to the consumer. - logs/log-views.ts — a "Level 1.5 / 2 / 3" scheme that appears nowhere else; the real contract is the five named views. Dropped, and the three banner rules with it (CLAUDE.md bans banner separators). Comment-only apart from the log-views banners.
1 parent bc210f6 commit 9cd4bbf

6 files changed

Lines changed: 10 additions & 15 deletions

File tree

apps/sim/lib/core/rate-limiter/hosted-key/queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface EnqueueResult {
6969
/**
7070
* Per-workspace+provider FIFO queue for hosted-key acquisitions.
7171
*
72-
* Callers `enqueue` to claim a position, then `waitForHead` until they're at
72+
* Callers `enqueue` to claim a position, then poll `checkHead` until they're at
7373
* the head, then attempt to consume from the token bucket. On success or cap
7474
* exceeded, they `dequeue` to make room for the next caller.
7575
*

apps/sim/lib/knowledge/search/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ const FTS_CONFIG = 'english'
314314

315315
/**
316316
* Reciprocal-rank-fusion damping constant. 60 is the value from the original RRF
317-
* paper and matches the docs Ask-AI retriever (`apps/docs/app/api/chat/route.ts`).
317+
* paper and matches the docs search retriever (`apps/docs/app/api/search/route.ts`).
318318
*/
319319
export const RRF_K = 60
320320

apps/sim/lib/logs/log-views.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ const DEFAULT_MATCH_TIME_BUDGET_MS = 5_000
4545
*/
4646
const DEFAULT_MAX_SCANNED_CHARS = 64 * 1024 * 1024
4747

48-
// Overview (Level 2): block tree with timing + cost, NO input/output.
49-
48+
/** Block tree with timing and cost, without input/output. */
5049
export interface OverviewSpan {
5150
id: string
5251
blockId?: string
@@ -75,10 +74,7 @@ export function toOverview(spans: TraceSpan[]): OverviewSpan[] {
7574
})
7675
}
7776

78-
// ---------------------------------------------------------------------------
79-
// Trace (Level 1.5): condensed per-block digest — names, statuses, counts.
80-
// ---------------------------------------------------------------------------
81-
77+
/** Condensed per-block digest: names, statuses, counts. */
8278
export interface TraceDigestEntry {
8379
/** Block id when the spans carry one; the drill-in key for `full` blockIds. */
8480
blockId?: string
@@ -125,9 +121,7 @@ export function toTrace(spans: TraceSpan[]): TraceDigestEntry[] {
125121
return Array.from(byKey.values())
126122
}
127123

128-
// ---------------------------------------------------------------------------
129-
// Full (Level 3): block tree WITH materialized input/output.
130-
124+
/** Block tree with materialized input/output. */
131125
export interface FullSpan extends OverviewSpan {
132126
startTime?: string
133127
endTime?: string

apps/sim/lib/resources/orchestration/restore-resource.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ type RestorableFolderType = 'folder' | 'knowledge_folder' | 'table_folder'
4848
/**
4949
* Deliberately a total `Record` over the folder types, not a `Partial` one: adding a tree to
5050
* `RestorableFolderType` without a mapping here has to fail the build. With a partial map the
51-
* lookup would yield `undefined`, `performRestoreFolder` would fall back to its `'workflow'`
52-
* default, and the restore would silently target the wrong tree.
51+
* lookup would yield `undefined`, which `restoreFolder` types as a required
52+
* `FolderResourceType` — so the failure would surface as an undefined folder config deep in
53+
* the cascade rather than at the call site.
5354
*/
5455
const FOLDER_RESOURCE_TYPE_BY_RESTORABLE: Record<RestorableFolderType, FolderResourceType> = {
5556
folder: 'workflow',

apps/sim/lib/table/import-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface BulkImportBatch {
5858
* Inserts one batch of rows for an async import in a single committed statement.
5959
*
6060
* Differs from {@link batchInsertRowsWithTx} for the bulk-load case: caller-supplied
61-
* contiguous positions (no `acquireTablePositionLock` / `nextAutoPosition` scan — an
61+
* contiguous order keys (no `acquireRowOrderLock` scan — an
6262
* import owns its hidden table as the sole writer), no `RETURNING`, and **no
6363
* `fireTableTrigger` / `runWorkflowColumn`** (a 1M-row import must not dispatch a
6464
* workflow run per row). `row_count` is maintained set-based by the statement-level

apps/sim/lib/table/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function readLocks(row: {
122122
* Uses an advisory lock (not `SELECT ... FOR UPDATE` on the definition row) so
123123
* it adds no edges to the row-lock graph — the row-count trigger (migration
124124
* 0198) locks the definition row from `insertRow`/`deleteRow`, and a FOR UPDATE
125-
* here would invert that order. Mirrors `acquireTablePositionLock`. The lock and
125+
* here would invert that order. Mirrors `acquireRowOrderLock`. The lock and
126126
* the read both release at COMMIT/ROLLBACK; the wait is bounded by the
127127
* `statement_timeout` set in `setTableTxTimeouts`.
128128
*/

0 commit comments

Comments
 (0)