Files
helmdocs-proposal-system/migrations/0002_seed_release_matrix.sql
Christian da74362d00 Initial v1 code layout
The destination of the wayfinder map: directory and module structure, the
domain model as real schema files, permission boundaries expressed as code,
and typed seams where the undecided parts land.

Satisfies the four structural requirements earlier resolutions handed to a
layout that did not exist:

  - a single database entry point (#11) — the pool is not exported
  - a scheduler entry point with actor context and no request (#13)
  - an entitlement assertion helper (#20, #34) — its call sites are the
    paid-feature list
  - an enumerated list of privileged RLS bypasses (#33) — three of them

Seams carry real types and throw with the ticket that owns them, so the
skeleton wires up and fails only where a decision is genuinely missing.

Verified: tsc --noEmit clean; drizzle-kit generate produces RLS on 18 tables
and 6 policies calling the release-level functions.

Resolves #35

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 17:20:47 -04:00

36 lines
1.8 KiB
SQL

-- Release matrix, version 1. Fixed by #14.
--
-- A rule change is a NEW VERSION, never an UPDATE. Without the version history
-- a past release cannot be reconstructed when an award is protested — the one
-- thing the function form of these rules costs.
--
-- Mirrored in src/release/matrix.ts, which the evaluation surface renders its
-- dimmed cells from. The screen and the policy must not be able to disagree.
INSERT INTO release_matrix (version, class, level, released) VALUES
-- Non-content pre-bid signal: who opened, who acknowledged, who intends to
-- bid. This is what #12 actually promised the retailer, and it is the reason
-- sealing response content costs them nothing they were counting on.
(1, 'vendor_identity', 'invited', 'true'),
(1, 'participation_signal', 'invited', 'true'),
-- Exact quantities behind the acknowledgement gate. The coarse volume band
-- stays in the teaser (#14 decision 4).
(1, 'scenario_quantity', 'acknowledged', 'true'),
-- Sealed until the deadline, then the whole field at once.
(1, 'answer_text', 'open', 'true'),
(1, 'exception_text', 'open', 'true'),
(1, 'vault_document', 'open', 'true'),
(1, 'price_quote', 'open', 'true'),
(1, 'derived_cost', 'open', 'true'),
-- A vendor's own scoring, released to them at award. They never see anything
-- of the field — no count, no identities, no rank including their own.
(1, 'own_scoring', 'awarded', 'true');
-- TWO-ENVELOPE, deferred not declined: moving price_quote and derived_cost to a
-- level reached only after scoring locks is a version bump here plus an
-- irreversible lock transition. That is the point of choosing a matrix over
-- lifecycle logic written inline in each policy.