<aside> 🔄

Updated 2026-10-31. Three decisions on this page changed after it was written, recorded as ADRs in the repo: state is session-only (HTML5 sessionStorage, no device save, no saved history, no clear-all) per ADR-0011, so the "On the device: saved scans / one button clears all" row below is replaced; a title resolves directly to its job function and the app never asks the user to disambiguate per ADR-0012, so rule 5 (ambiguous titles, the person chooses) below is replaced; and the framework is the single source of truth, the LLM recognizes wording only and determines nothing per ADR-0010. UI rules are in ADR-0013.

</aside>

<aside> 🔒

The record of decision is in the repo: ADR-0006 (three-tier), ADR-0022 (JSONB + sliced snapshot data model, revising ADR-0008's table shapes), ADR-0008 (integrity rules), ADR-0005 (scope). This page is the readable version. All row counts are measured from the framework clone at commit 636635a (content hash 9072373e7186a04b).

</aside>

Where data lives

Store Holds User data?
Supabase Postgres (tier 3) The framework: job functions, duties (hats), activities, skills, deliverables, tools, and their links. Every synced version. No
The published snapshot file (built by tier 2) Pre-joined, read-optimized lookups for one version, served to the browser No
On the device (browser storage) Saved scans (title, posting, result, the version that produced it). One button clears all. Yes, and it never leaves the device except the posting sent to decode

The browser never connects to Supabase. Only tier-2 server code does (ADR-0006).

Supabase tables (framework data only)

<aside> 🔄

Superseded by ADR-0022: the framework is now stored as versioned JSONB, not the normalized tables shown here. The current model is in the next subsection; the normalized tables below it are kept for history. The integrity rules from ADR-0008 still hold and are enforced at build.

</aside>

Current model (ADR-0022): versioned JSONB + sliced snapshot

Table Key Holds
spf_release upstream commit SHA One row per synced version (SHA, status, content hash, counts); exactly one is published
spf_record (release, entity, slug) One row per framework record: its name plus the record itself in a data jsonb column. This makes "resolve by (entity, slug)" a real primary key and sidesteps the 183 cross-entity slug collisions.

The read model is not the database. At build time, tier-2 code reads the published release and emits a small title index plus one snapshot slice per job function (its hats, and each hat's activities, deliverables, and tools) to the CDN. The browser and the decode route read those slices; nothing queries Supabase at request time. This is CQRS: the JSONB tables are the write side, the snapshot slices are the read model.

Historical normalized tables (superseded by ADR-0022)

Table Key Holds Rows at 636635a
spf_release upstream commit SHA One row per synced version; exactly one is "published" 1 per sync
job_function (release, slug) Name, description 11
duty (a hat) (release, slug) Name + plain-language fields 18
activity (release, slug) Name, description, owning duty 100
skill / deliverable / tool / specialization (release, slug) Name + the text resume tips need 115 / 104 / 17 / 23
job_function_duty both slugs Which hats each title expects 37
duty_activity_raci duty, activity, role Each hat's tasks tagged R / A / C / I 2,752
duty_skill duty, skill, kind Required, foundational, or first-step 884
duty_tool / duty_deliverable both slugs Tools and deliverables per hat 56 / 129
title_alias normalized title Real-world title to job function; an ambiguous title gets more than one row 53 titles

Integrity rules the database and build enforce (ADR-0008)

These are the fixes from the skeptical audit. The build fails closed when data breaks them, so a wrong join never reaches a user.

  1. Resolve every link by (entity, slug), never slug alone. 183 slugs occur in more than one entity, so a slug by itself is ambiguous. A link that resolves to zero or more than one entity fails the build.
  2. One owner per fact. The job-function-to-duty link is stored once (on the job function); the build recomputes the duty side and fails if they disagree. They agree today (37 pairs).
  3. Degenerate duties. everyone is excluded (not a real role). The 2 duties with zero activities (ux-user-experience-strategy, account-management) stay as expected hats for their titles, but the matcher may not report them as "written," since they have no evidence phrases. ADR-0039's proportional scoring relies on this exclusion: the everyone duty never scores, and a hat's denominator is the activities and deliverables that roll up to it under ADR-0021, so a hat with very few items reaches full on fewer matches.
  4. Match evidence per hat is the duty's own activities and tasks, not its Consulted or Informed references to other duties' activities (those are 799/808 and 1602/1700 owned elsewhere).
  5. Ambiguous titles are never auto-resolved (4 of them, e.g. "product designer" to 3 functions). The person picks. Uncovered titles are said plainly with the supported list.
  6. Pin by commit, stamp every result. The manifest "v1" never changes, so the snapshot is pinned to the commit SHA and every result records the SHA that made it.