Skip to content

Design Resolution Collection

Overview

The tenant-scoped wf2des decision ledger โ€” an autonomous quality ratchet for component selection. There is no human-correction loop, so quality must converge machine-side: the ledger maps a deterministic, versioned structural section signature to the best accepted component resolution for each structural KIND of section. generation-assemble OWNS this collection โ€” it CONSULTS the ledger before model selection and WRITES BACK through a score ratchet after the deterministic guards; no other run touches it. One doc per resolved section KIND, keyed by a structural, LLM-free section_signature, so the same section KIND hits the same entry on every screen and every rerun. It is not a vector index or learning corpus.

Table Definition

Logical Name Physical Name Column Name Data Type Primary Key Relation Unique Nullable Default Value Remarks
Design Resolution design_resolution _id string โ—ฏ {organization_id}_{project_id}_{section_signature} โ€” this IS the identity; no separate surrogate
organization_id number Tenant owner; mandatory tenancy scope on every read/write
project_id number project:id Project scope; mandatory tenancy scope on every read/write
section_signature string STRUCTURAL section identity, versioned (sig@1:โ€ฆ) โ€” sha256 over the section's kit-component names, normalized name, child-type shape, and text count. Deterministic and LLM-free (never the LLM-assigned roles), so the same section KIND hits the same entry on every screen and rerun
case string instance | compose
platform_design_id string design:id โ—ฏ The resolved component (= design_component._id); null for a compose resolution
component_name string Display/debug convenience
variant_policy object axis โ†’ value; CLAMPED to registry axes before write
provenance string mined | voted (see Type Codes); mined evidence has authority over votes
score float DETERMINISTIC decision quality (base + modeled + variant-completeness + scope-fit; mined = 1.0) โ€” the ratchet's currency
prompt_version string Provenance of a voted decision
updated_at string Last accepted ratchet write (ISO-8601 UTC timestamp)

Relations

  • _id = {organization_id}_{project_id}_{section_signature}, by value โ€” the sole identity, no surrogate.
  • project_id โ†’ project.id
  • platform_design_id โ†’ the platform design row id (type=component) = design_component._id, by value.
  • No relation is enforced inside DocumentDB; relations are logical and validated by application code.

Indexes

  • PRIMARY KEY (_id)
  • SCORE-RATCHET upsert on _id: a voted write lands only where the held entry is NOT mined AND scores STRICTLY lower (server-side filter; a DuplicateKeyError on the fenced upsert means KEPT, returned as such โ€” never an error). mined writes are unfenced. Identical evidence scores identically โ†’ reruns never churn; better decisions win โ†’ monotonic improvement.
  • Every read and write filters organization_id + project_id (tenancy scope).

Type Codes

provenance:

  • mined: read from designer-made designs already in the Figma file โ€” the only above-vote authority (score = 1.0).
  • voted: the K-sample self-consistency selection vote.

case:

  • instance: a single registered component resolves the section.
  • compose: the section is composed from multiple units (each unit re-selects).

Notes

  • generation-assemble OWNS writes โ€” assemble-only; no other run touches this collection. One doc per resolved section KIND (not per screen).
  • CONSULT (assemble, BEFORE selection): a mined entry LOCKS its section and skips the selection call (no LLM). voted entries are retained as diagnostics and never override current-screen selection. Instance entries are revalidated at consult: a stale entry whose component is not among the section's candidates falls through to the vote, and default-variant entries are scope-revalidated (default_size speaks only for the default variant).
  • WRITE-BACK (assemble, AFTER the guards): every non-unmatched section (and compose-child) decision upserts with its deterministic score, fenced by the ratchet.
  • Evaluation runs may disable ledger reads and writes; production defaults keep both enabled.
  • section_signature is the crux: because it is STRUCTURAL and LLM-free, it is stable across screens and reruns โ€” the ledger accumulates per section KIND, not per instance.
  • No lineage block โ€” the ledger is a running decision cache keyed by structural identity, not a lineage-tracked artifact; updated_at records the last accepted write.
  • See the wf2des I/O Definition for the assemble consult / write-back steps and the score-ratchet fence.