Skip to content
Merged
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
16 changes: 8 additions & 8 deletions guardrails.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"count": 1
},
{
"key": "src/modules/onboarding/starter-list.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- the query is the same read as feed/units.ts's, and the extraction that would merge them does not typecheck (see above); what differs after it is the part that matters, since \"no location\" and \"no unit preference\" are different facts with different right answers",
"reason": "Same two-column read of user_profiles as feed/units.ts's unitsFor, and the extraction into lib/keyed-read provably does not compile: drizzle infers a row type for a literal column map and stops for a generic one, widening select().from().where() to a union that includes the query builder, so the awaited value is neither iterable nor indexable. Four shapes were tried (annotated result, .all(), .execute(), a generic table param) \u2014 the same class of failure CLAUDE.md already records for wrapping createServerFn. What differs after the query is the part that matters: \u201cno location\u201d and \u201cno unit preference\u201d are different facts with different right answers.",
"key": "src/modules/onboarding/starter-list.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- the query is the same read as feed/conditions/units.ts's, and the extraction that would merge them does not typecheck (see above); what differs after it is the part that matters, since \"no location\" and \"no unit preference\" are different facts with different right answers",
"reason": "Same two-column read of user_profiles as feed/conditions/units.ts's unitsFor, and the extraction into lib/keyed-read provably does not compile: drizzle infers a row type for a literal column map and stops for a generic one, widening select().from().where() to a union that includes the query builder, so the awaited value is neither iterable nor indexable. Four shapes were tried (annotated result, .all(), .execute(), a generic table param) \u2014 the same class of failure CLAUDE.md already records for wrapping createServerFn. What differs after the query is the part that matters: \u201cno location\u201d and \u201cno unit preference\u201d are different facts with different right answers.",
"count": 1
},
{
Expand Down Expand Up @@ -484,12 +484,12 @@
"count": 1
},
{
"key": "src/modules/onboarding/profile.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- rhymes with feed/share-default.ts's defaultAudienceFor: same select-by-userId-with-limit-1-then-??-default shape, but a different column with a different default (not-yet-onboarded vs public-by-default) that will evolve on its own product timeline",
"reason": "Pair A, both sides. See the matching grant on `modules/feed/share-default.ts`: same skeleton, different column, different default, different module, no shared home. Owner's call, 2026-09-21 (task 115).",
"key": "src/modules/onboarding/profile.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- rhymes with feed/entries/share-default.ts's defaultAudienceFor: same select-by-userId-with-limit-1-then-??-default shape, but a different column with a different default (not-yet-onboarded vs public-by-default) that will evolve on its own product timeline",
"reason": "Pair A, both sides. See the matching grant on `modules/feed/entries/share-default.ts`: same skeleton, different column, different default, different module, no shared home. Owner's call, 2026-09-21 (task 115).",
"count": 1
},
{
"key": "src/modules/closet/components/GarmentForm.tsx|analyzer-ignore|// fallow-ignore-next-line code-duplication -- a ten-prop signature that matches feed/components/KitPicker.tsx KitList only by destructuring one prop per line; one edits a garment, the other picks a kit, and they share nothing to extract",
"key": "src/modules/closet/components/GarmentForm.tsx|analyzer-ignore|// fallow-ignore-next-line code-duplication -- a ten-prop signature that matches feed/attach/components/KitPicker.tsx KitList only by destructuring one prop per line; one edits a garment, the other picks a kit, and they share nothing to extract",
"reason": "Owner's call, 2026-09-25: a destructured-props signature, not a clone. Semantic mode matches any two components that destructure ten-plus props one per line, whatever the names and types, so two unrelated components rhyme. The alternative, reading props through `props.` in one of them to break the skeleton, was put to the owner and declined as code written only to dodge the detector.",
"count": 1
},
Expand All @@ -504,7 +504,7 @@
"count": 1
},
{
"key": "src/modules/runs/imports/components/ParsedCard.tsx|analyzer-ignore|// fallow-ignore-next-line code-duplication -- a many-prop signature that matches feed/components/Feed.tsx FollowingTab only by destructuring one prop per line; one is a parsed run, the other the Following tab, and they share nothing to extract",
"key": "src/modules/runs/imports/components/ParsedCard.tsx|analyzer-ignore|// fallow-ignore-next-line code-duplication -- a many-prop signature that matches feed/following/components/Feed.tsx FollowingTab only by destructuring one prop per line; one is a parsed run, the other the Following tab, and they share nothing to extract",
"reason": "Owner's call, 2026-09-25: a destructured-props signature, not a clone. Semantic mode matches any two components that destructure ten-plus props one per line, whatever the names and types, so two unrelated components rhyme. The alternative, reading props through `props.` in one of them to break the skeleton, was put to the owner and declined as code written only to dodge the detector.",
"count": 1
},
Expand Down Expand Up @@ -614,8 +614,8 @@
"count": 2
},
{
"key": "src/modules/safety/review/desk-kit.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- fallow 3.34 matches drizzle's select/from/join/where grammar across tables; deskKitFor is the one read of a kit for the Desk, and its pieces already come from kitPiecesSelect, which feed/public-kit.ts shares",
"reason": "Fallow 3.34 (#3491) reads the object a call receives and no longer drops a method chain, so semantic mode matches drizzle query builders over different tables and columns: 34 new clone groups on main. Each was read on both sides; the real copies were extracted in the same PR (runsWithEntry, ownerHandles, recentOwnEntries for prefill and itemBandWearStat), and what remains is the query grammar. fallow-ignore-next-line only covers a clone that starts on the next line and fallow has no block form, so the comment sits where each clone starts. Owner's call, 2026-10-26: fix where possible, suppress the rhymes inline. Owner's call 2026-11-09 (#388): the kit's garment read was extracted (kitPiecesSelect, shared with feed/public-kit.ts); these three are the query grammar.",
"key": "src/modules/safety/review/desk-kit.ts|analyzer-ignore|// fallow-ignore-next-line code-duplication -- fallow 3.34 matches drizzle's select/from/join/where grammar across tables; deskKitFor is the one read of a kit for the Desk, and its pieces already come from kitPiecesSelect, which feed/public-web/public-kit.ts shares",
"reason": "Fallow 3.34 (#3491) reads the object a call receives and no longer drops a method chain, so semantic mode matches drizzle query builders over different tables and columns: 34 new clone groups on main. Each was read on both sides; the real copies were extracted in the same PR (runsWithEntry, ownerHandles, recentOwnEntries for prefill and itemBandWearStat), and what remains is the query grammar. fallow-ignore-next-line only covers a clone that starts on the next line and fallow has no block form, so the comment sits where each clone starts. Owner's call, 2026-10-26: fix where possible, suppress the rhymes inline. Owner's call 2026-11-09 (#388): the kit's garment read was extracted (kitPiecesSelect, shared with feed/public-web/public-kit.ts); these three are the query grammar.",
"count": 3
}
]
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* **Why this check exists at all.** A route is in the client bundle, so what
* it imports at module scope has to be reachable without `env` — and when
* it is not, almost nothing says so. Pulling one decision out of
* `feed/entries.ts` into a route loader dragged `cloudflare:workers` into
* `feed/entries/entries.ts` into a route loader dragged `cloudflare:workers` into
* the browser bundle and broke `npm run build`; a second did the same with
* the whole drizzle schema, 23 kB of it, and that one did not fail at all.
* Neither is visible to tsc, to eslint, to dependency-cruiser or to the
Expand Down
12 changes: 6 additions & 6 deletions src/db/schema-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
* `strangerAudiences` (SHARED or PUBLIC, D-151). The two shared-entry
* indexes are partial on exactly this expression, and SQLite uses a
* partial index only for a query whose WHERE carries the same expression,
* so the stranger rule (`safety/visibility.ts`) and the feed's seek call
* so the stranger rule (`safety/rules/visibility.ts`) and the feed's seek call
* this rather than writing their own. The values are literals, not bound
* parameters, for the same reason: a parameter cannot prove the index's
* condition. They are the contract's own constants, never input.
Expand All @@ -76,7 +76,7 @@ export const userProfiles = /*#__PURE__*/ sqliteTable(
userId: text("user_id").primaryKey(),
// The runner's handle (task 126, ACC-1; decision D-41 replaced
// `display_name` with it). Stored lowercased, as the rule types it;
// null until O0. `modules/account/username.ts` is the one writer.
// null until O0. `modules/account/handles/username.ts` is the one writer.
username: text("username"),
cityLabel: text("city_label"),
lat: real("lat"),
Expand Down Expand Up @@ -136,7 +136,7 @@ export const userProfiles = /*#__PURE__*/ sqliteTable(
// On by default: published totals count shared and private runs, and
// an opted-out runner leaves them at the next nightly build. It is also
// U2's conditions pool (owner, 2026-10-12): off leaves their shared runs
// out of the in-app Same conditions block at once (`feed/consensus.ts`),
// out of the in-app Same conditions block at once (`feed/consensus/consensus.ts`),
// while the block still works for them. The guide job and consensus read
// it; `onboarding/aggregate-prefs.ts` is the one writer.
countInTotals: integer("count_in_totals", { mode: "boolean" })
Expand Down Expand Up @@ -508,7 +508,7 @@ export const inviteCodes = /*#__PURE__*/ sqliteTable(
* two sign-ups racing for a single-use code from both getting it: a row
* counts against the code while its account exists *or* its hold is live,
* so a sign-up that died between the claim and the account frees the
* code when the hold runs out (`modules/account/invites.ts`).
* code when the hold runs out (`modules/account/access/invites.ts`).
*
* **A use is an address, and once made it is permanent.** Uses are
* counted by distinct `email`, so a retried sign-up's second claim is the
Expand Down Expand Up @@ -847,7 +847,7 @@ export const wardrobeItems = /*#__PURE__*/ sqliteTable(
// dHash, taken from the upload before it is re-encoded. Written and
// cleared in the same statement as `photo_key`, so it never outlives
// the photo it describes. Read only by the takedown review's copy
// search (`safety/photo-matches.ts`). NULL for a photo uploaded before
// search (`safety/review/photo-matches.ts`). NULL for a photo uploaded before
// it existed, which then matches nothing.
photoFingerprint: text("photo_fingerprint"),
productUrl: text("product_url"),
Expand Down Expand Up @@ -972,7 +972,7 @@ export const runs = /*#__PURE__*/ sqliteTable(
* cron clears it on a run that is `pending` again.
* - **Feed's half** (`verdict`, `entry_created_at`, `entry_shared`):
* written in the batch that creates the entry or saves its verdict and
* audience (`feed/entries.ts`), and cleared when the entry is retracted.
* audience (`feed/entries/entries.ts`), and cleared when the entry is retracted.
*
* `judged_feels_like_c` is `judgedFeelsLikeC` in SQL: the coldest hour if
* the run felt cold, the warmest if it felt warm, else the start. A test
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chunked.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Split a list into runs of at most `size`, in order.
*
* Pulled out of `feed/conditions.ts`, where the same index loop carried
* Pulled out of `feed/conditions/conditions.ts`, where the same index loop carried
* three `Stryker disable` directives — the mutants were unkillable *there*
* because chunking only changes what a query **scans**, and the answer is
* assembled by matching keys afterwards. Scanned rows are what D1 bills,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/contracts/audience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const WORLD_AUDIENCE = "world" satisfies WritableAudience;
* it counts in the feed, consensus and "worn by N" like a SHARED one.
* Every read that shows an entry to someone other than its author tests
* for these and nothing else (`safety/rules/visibility.ts`'s one rule,
* `feed/feed.ts`'s index seek), so a `groups` row is hidden from strangers
* `feed/following/feed.ts`'s index seek), so a `groups` row is hidden from strangers
* without anyone having to remember it.
*/
export const strangerAudiences = [
Expand Down
2 changes: 1 addition & 1 deletion src/lib/contracts/temperature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pure temperature/precipitation classification and display helpers —
* no D1, no env, no bindings. This split exists specifically so route
* *components* (which ship to the browser) can use these without pulling
* in modules/feed/conditions.ts's `env`/drizzle-orm imports into the
* in modules/feed/conditions/conditions.ts's `env`/drizzle-orm imports into the
* client bundle: Vite/Rolldown must resolve every static import in a
* file's module graph before it can tree-shake unused bindings, and
* `cloudflare:workers` (imported by src/env/index.ts) has no client-side
Expand Down
2 changes: 1 addition & 1 deletion src/lib/photo-constraints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* These live in lib/ specifically so a component can import them. Lane 104
* re-declared them inside routes/feed/verdict.$entryId.tsx with a comment
* explaining that importing modules/feed/photos.ts would drag D1- and
* explaining that importing modules/feed/entries/photos.ts would drag D1- and
* env-touching code into the client bundle. That reason was correct; the
* conclusion was not. Pure constants belong in lib/, where both sides can
* reach them and neither owns them.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sql/fingerprint-distance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* as SQL (D-142, design 146): what lets a `WHERE` and a `LIMIT` apply to a
* Hamming distance SQLite has no operator for. Shared by the takedown
* review's copy search (`safety/review/photo-matches.ts`) and the upload's check
* against removed images (`feed/photos.ts`, D-147).
* against removed images (`feed/entries/photos.ts`, D-147).
*
* Every fingerprint given here is spelt into the SQL, so each caller
* parses what it passes through `fingerprintSchema` first.
Expand Down
2 changes: 1 addition & 1 deletion src/modules/closet/components/GarmentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ type UpdateValue = <K extends keyof GarmentFormValues>(
* sentence or the failure band — so the schema is the single gate and
* `useFormSubmit` renders what it says.
*/
// fallow-ignore-next-line code-duplication -- a ten-prop signature that matches feed/components/KitPicker.tsx KitList only by destructuring one prop per line; one edits a garment, the other picks a kit, and they share nothing to extract
// fallow-ignore-next-line code-duplication -- a ten-prop signature that matches feed/attach/components/KitPicker.tsx KitList only by destructuring one prop per line; one edits a garment, the other picks a kit, and they share nothing to extract
export function GarmentForm({
heading,
back,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/dispatch/scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export async function handleScheduled(
* requests invited or declined 90 days ago (`account/access/answered-requests.ts`).
* **The copyright holds' sweep** (D-130) is `feed`'s, which imports `ops`:
* it restores what a counter-notice saved on its 12th weekday and deletes
* what was held 30 days with none pending (`feed/moderation.ts`).
* what was held 30 days with none pending (`feed/moderation/moderation.ts`).
*
* **The speed digest** (design 165) is ops' own, and a field for the
* digest email's reason: so a test hands in a fake rather than reach the
Expand Down
2 changes: 1 addition & 1 deletion src/modules/enrichment/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function putSnapshot(
* R2 and D1 (law 8c). The order is the one that fails safely: an object with
* no row is invisible but recoverable, where a row pointing at an object
* that was never written is a snapshot that lies about existing, and
* `reextract` would break on it. `feed/photos.ts` makes the same trade for
* `reextract` would break on it. `feed/entries/photos.ts` makes the same trade for
* the same reason.
*
* The residue is an orphaned object when D1 fails between the two. `MEDIA`
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboarding/aggregate-prefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { CountInTotalsChoice } from "./inputs";
/**
* Whether a runner's runs count in published anonymous totals (D-108 D)
* and in the in-app Same conditions block (U2's pool, folded in by the
* owner, 2026-10-12; `feed/consensus.ts` reads the column itself): the one
* owner, 2026-10-12; `feed/consensus/consensus.ts` reads the column itself): the one
* reader A3 needs, and the one writer, Settings › Sharing's switch. The writer is reached through `requireUserId()`, not the
* confirmed gate (owner, 2026-10-11): it is the runner's own choice,
* visible to nobody, and turning totals off must never wait on a confirm.
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboarding/components/TotalsSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { SavedSwitchRow } from "./saved-switch";
* - **The switch is U2's conditions pool too** (owner, 2026-10-12: fold U2
* into `count_in_totals`; round 38 retires U2's card). Off also leaves a
* runner's shared runs out of the in-app Same conditions block
* (`feed/consensus.ts`), at once, while the block still works for them —
* (`feed/consensus/consensus.ts`), at once, while the block still works for them —
* so both lines say so. One switch, one writer (`setCountInTotals`).
*/
export const TOTALS_LABEL = "Count my runs in anonymous totals";
Expand Down
4 changes: 2 additions & 2 deletions src/modules/onboarding/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export async function completeOnboarding(
* account that has never reached O1 — and the common one, since the row is
* created by O1 itself.
*/
// fallow-ignore-next-line code-duplication -- rhymes with feed/share-default.ts's defaultAudienceFor: same select-by-userId-with-limit-1-then-??-default shape, but a different column with a different default (not-yet-onboarded vs public-by-default) that will evolve on its own product timeline
// fallow-ignore-next-line code-duplication -- rhymes with feed/entries/share-default.ts's defaultAudienceFor: same select-by-userId-with-limit-1-then-??-default shape, but a different column with a different default (not-yet-onboarded vs public-by-default) that will evolve on its own product timeline
export async function hasOnboarded(
db: DrizzleD1Database,
userId: string,
Expand Down Expand Up @@ -246,7 +246,7 @@ export interface CurrentSettings extends Preferences {
* nullable — a profile predates the question, or the row does not exist at
* all — and a `<select>` cannot render "no answer" for a required choice.
* `defaultUnits` is what the rest of the app already falls back to
* (`feed/units.ts` does the same), so settings shows the same Fahrenheit
* (`feed/conditions/units.ts` does the same), so settings shows the same Fahrenheit
* and miles a feed reader is already seeing rather than a blank the save
* would then have to invent a value for.
*
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboarding/starter-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function bandFor(
// wrapping `createServerFn`: the concrete version compiles and the
// generic one cannot.
//
// fallow-ignore-next-line code-duplication -- the query is the same read as feed/units.ts's, and the extraction that would merge them does not typecheck (see above); what differs after it is the part that matters, since "no location" and "no unit preference" are different facts with different right answers
// fallow-ignore-next-line code-duplication -- the query is the same read as feed/conditions/units.ts's, and the extraction that would merge them does not typecheck (see above); what differs after it is the part that matters, since "no location" and "no unit preference" are different facts with different right answers
const [row] = await db
.select({
lat: userProfiles.lat,
Expand Down
Loading