Skip to content

Instantly share code, notes, and snippets.

@timschoch
timschoch / accounts-v2migration.md
Created August 1, 2026 23:56
Wayfinder #620 — Accounts target area model + v2migration sidecar (Habits, map #546)

Accounts — v2 transition notes

Sidecar to accounts.md. Everything transient about the v1→v2 transition lives here — v1↔v2 comparisons, renames, the drop-list, migration TODOs, cross-spoke handoffs, and the model's open questions. Delete at v2 release; the spoke reads complete without it. Baseline: as-built identity & accounts #549. Auth research: #862.

Rename map (v1 → v2)

v1 (as-built) v2 (target)
persons.role: adult | kid split into three — personGroup: adult|kid + uiLevel: simple|advanced + admin: boolean
sessions (app-owned table) Better Auth's session table + typed additionalFields
@timschoch
timschoch / auth-approach-research.md
Last active August 1, 2026 22:38
Wayfinder #862 — Auth approach research: library vs hand-rolled (Habits, map #546)

Auth approach research (#862)

Evidence-backed answer to the nine questions. Every capability claim traces to a doc URL fetched during this research. Claims that could not be verified are marked unverified rather than inferred.

Recommendation (short)

Adopt Better Auth (MIT, self-hosted, tables in your own Neon Postgres). Keep the three session axes, the hub-vs-personal step-up asymmetry, and the parent gate as app-owned domain code.

Better Auth is the only candidate that carries deviceMode / activePersonId / stepUpVerifiedAt as typed, first-class columns on its own session table, writable mid-session without re-login, in a table that lives in your database under your Drizzle schema. Every other candidate either fixes the session schema (Auth.js database strategy), pushes custom state onto the user rather than the session (Stack/Hexclave, Supabase, Zitadel, Logto), or makes it vendor-primary metadata mapped into a JWT with a staleness window (Clerk ~60s, WorkOS ~5min).

@timschoch
timschoch / macro-flow-553.md
Created July 20, 2026 22:16
Habits #553 — Macro-flow (target lifecycle, TARGET/DRAFT)

Macro-flow — Habits target lifecycle

TARGET / DRAFT — desired-target spine, not as-built. Resolves wayfinder ticket #553 "Macro-flow definition", child of map #546 Domain-model & flow SSOT. Coarse app rhythm as named nodes, not screens. Purpose: challenge the #552 microkernel partition and feed the convergence gate (#555).

Decisions (from grilling)

@timschoch
timschoch / wf-556-lifecycle.md
Created July 16, 2026 01:24
Wayfinder #556 — Baseline: data lifecycle & action/time axis (current as-built)

Baseline: Data lifecycle & action/time axis (current as-built) — 2026-07-16

Wayfinder #556 asset. Code-first snapshot; the temporal companion to the three structural baselines — spine (#547 gist f5f6c3a9…), day-structure (#548 gist daaccfdd…), identity (#549 gist f3dcbcf0…). Reuses their vocabulary (Item = one atom; Occurrence identity (item, subject, day, block), UNIQUE NULLS NOT DISTINCT; Event = per-person write; seal = 02:00 freeze). Those said what the tables are; this says when each row is written, changed, frozen, and read — and who/what triggers it. As-built only, no target design.

0. The four write triggers (the whole clock)

Only four things ever cause a domain write. Everything below is one of these firing:

Trigger Fires when Actor Sync/deferred Writes
Day-view open (today) someone loads / for day === today any person's device sync, on request materializes due duty rows (materializeDay(db, today, today))
@timschoch
timschoch / SassMeister-input.scss
Created February 18, 2016 15:21
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// why does this need interpolation to work?
@function capitalize( $string ) {
@return '#{to-upper-case(str-slice($string, 1, 1))}' + str-slice($string, 2);
}
works {
bar: capitalize( foo );
@timschoch
timschoch / SassMeister-input-HTML.html
Created February 16, 2016 11:53
Generated by SassMeister.com.
<div class="foo">
<input />
<button>Search</button>
</div>
<div class="bar">
<input />
<button>Search</button>
</div>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
#s4-workspace {
position: fixed;
.lighten .swatch1 {
background-color: #f0803f;
}
.tint .swatch1 {
background-color: #ec712a;
}
.darken .swatch1 {
background-color: #bb4d0e;
@timschoch
timschoch / SassMeister-input-HTML.html
Created July 30, 2015 09:03
Generated by SassMeister.com.
<h2 style="clear:both">SPAN</h2>
<div><span>fjkasdö lfjaösdjkaösdjasd f</span></div>
<div><span>asdeljf aölsfj öasdjf ölasjdf öjasdö fjkasdöf</span></div>
<h2 style="clear:both">DIV</h2>
<div><div>fjkasdö lfjaösdjkaösdjasd f</div></div>
<div><div>asdeljf aölsfj öasdjf ölasjdf öjasdö fjkasdöf</div></div>
@timschoch
timschoch / SassMeister-input-HTML.html
Last active August 29, 2015 14:26
Generated by SassMeister.com.
<div><span>fjkasdö lfjaösdjkaösdjasd f</span></div>
<div><span>asdeljf aölsfj öasdjf ölasjdf öjasdö fjkasdöf</span></div>