Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 9.99 KB

decisions.md

File metadata and controls

45 lines (37 loc) · 9.99 KB

Decisions and production blockers

This register implements technical constraints from the revised specification, not economic authority or operational acceptance. No existing app, database, migration history, plaa-sync checkout or Git repository was present. Nothing in live infrastructure was inspected or changed.

Accepted implementation choices

Choice Reason / exact boundary
Plain ordered SQL, PostgreSQL 16.10, stdlib Python/psql Existing schema specification, not app scaffolding. btree_gist exclusions and security_invoker views require the documented baseline. Native disposable tests avoid the unavailable Docker daemon.
Non-login plaa_owner, separate runtime roles Owner is migration/definer trust root; runtime roles have no ownership, inheritance, superuser or BYPASSRLS. Explicit owner RLS policies permit audited definer operations despite FORCE RLS. No PUBLIC function execution in project schemas, or schema creation.
Stable (source, source_ref) namespace shared across manifest kinds A business key cannot silently change kind. Source-specific adapters must namespace durable source IDs. SHA-256 covers canonical JSONB business request, including event time, revision, policy and inputs. actor and retry import_batch are excluded from payload comparison; original actor/batch remain recorded. Hashes are not event identity. Conflicts raise explicit errors, not successful quarantined imports.
Protected PID + transaction-ID context table Member-reader arbitrary GUCs are irrelevant. Trusted backend alone binds a currently verified active Directory subject; one binding per transaction. Backend must verify session and authorization first; SQL does not authenticate browsers. Stale rows cannot authorize another transaction and are pruned for the same PID on next bind. Routine context retention/pruning across abandoned backend PIDs needs operational maintenance.
Opaque identifier case preserved; trim whitespace directory_uid, legacy_member_uid, wallet, surus retain case. Email is lower/trim canonicalized but never auto-verified or used to merge people. Only explicitly verified temporal mappings resolve imports/auth; runtime admin approval is a trust boundary. Source normalization beyond this requires reviewed per-type adapters.
Exact untyped numeric API checks before column assignment Points (14,2), Rights/PLAA/price/USD (20,8), weights (7,6), Trust quantity/value (24,8). Reject nonfinite values, overflow, nonzero excess fractional digits; trailing zero precision is harmless. No floats/rounding/currency conversion. Owner direct casts can already have rounded values; owner DDL/DML is outside runtime API guarantees.
Half-open finite date intervals, NULL for unbounded end Temporal exclusions reject overlap and empty/reversed ranges and allow adjacency. UTC date extraction prevents session-timezone repricing. All schedule amounts/start dates are frozen, not just used ones; successor closure is the only schedule update API. Historical correction creates a separate manifest + reversal/replacement.
Confirmed-source settlement import only Literal version source-confirmed-v1 labels the adapter contract, not approval of an economic algorithm. Input event IDs/cutoff/allocation version and immutable allocation snapshot are retained. External source validity/approval remains an operator prerequisite. No automatic point conversion, proportional allocation, rounding, caps, fills or clearing.
IA pointers per category; IR pointer per monthly round Both use round locking, expected predecessor, compensations, exact reconciliation and immutable history. This implementation requires an explicit round for IR; unassigned-period IR imports remain blocked pending source mapping, rather than guessing a monthly key. A batch can correct only selected IA categories. Zero distributions have no issuance rows.
Explicit net balance fields ia_net_plaa, ir_net_plaa, unallocated_net_plaa, plaa_balance. No existing consumer/API was supplied, so no speculative gross-name alias is added. Consumers must review gross/net semantics before integration. effective_at and recorded created_at remain separate. Reversals retain original effective time; use source-backed corrections, not arbitrary retrospective repricing.
Source-backed unallocated adjustments/redemptions Separate confirmed-source API, with reason and manifest. No invented opening balances; no holdings inferred from bids. Allocated issuance corrections can only go through atomic settlement correction, not single-entry reversal.
Immutable Trust chains, advisory logical-key locks Same-key sequential revisions, first-of-month dates, fixed asset unit. Team quantity never calculates Trust NAV/value. Current/as-reported readbacks use validated revisions, not mutable snapshots. Raw bid corrections are new records with validated same-auction/member predecessor links; original reported amount stays untouched.
Initial narrow admin endpoints, not a generic SQL editor Configuration, identity closure/triage, submission review, confirmed IA/IR correction, holdings/valuation revisions, bounded audit/reconciliation reads. Draft-round allocation amendments, auction metadata revision, variable manually-awarded submission points and new bid formats require reviewed source-specific adapters; current APIs reject/omit them rather than expose arbitrary DML. Admin UI/UX is not delivered.
No production export builder enabled Pending contract table + seven empty persisted allowlisted candidate outputs. k≥5 checks alone do not prove privacy. No approval toggles can enable output; an approved executable contract-specific forward migration is necessary. Synthetic coarsening/differencing examples are evidence of risks and possible utility, not real approval.
No legacy access-code table Directory sign-in is target. No plaintext/hashed code subsystem or production credentials created.
Fresh-install only No upgrade target was provided. Replay/checksum checks are migration-runner checks, not certification of upgrading an existing legacy database. Forward upgrade preflight is a prerequisite if an existing target later appears.

Phase 0 launch blockers — all OPEN

  1. Economics/source authority: Product owner must choose receiver-only or paired kudos, policy version, historical effective dates and source mapping. Synthetic approvals are installed only by fictional fixtures, never production migrations. Confirm IA/IR categories, source allocations, calculation/rounding policy if computation is desired, earliest reliable history, tolerances and approved source-backed opening adjustments. A stored source confirmation is not authority to issue PLAA.
  2. Auth and API: Directory engineering must prove verified sign-in subject mapping, active participant authorization, backend isolation, pooled transactions and profile API compatibility. No member receives DB credentials. Any genuine legacy credential exception needs a separate ADR covering salted hashes, expiry, revocation, rate limits and removal date before implementation.
  3. Warehouse/Trust sharing: Product/data and infrastructure data owners must approve exact grains, distinct-contributor definition, k≥5, complementary suppression, rounding, cross-release/revision/differencing adversarial suite, retention of release history, consumer use cases and measurable minimum utility. Profile actual contributor counts at round/category/activity and multi-round/coarsened alternatives; report suppression rates. Trust-only data still needs source/audience approval. Failed fine grains are coarsened or deferred; never lower k. Factorio system-of-record ownership/integration is a separate decision.
  4. Delivery and funding: Accept the repository/maintainer/review path, named migration/admin implementer and reviewer, data/export DRI, Directory DRI and Trust liaison; distinguish reviewer from approver. Record weekly hours, availability, competing commitments, deliverables, response expectations and escalation. Offered support/GitHub review is not funded engineering capacity. Scope, allocation decision-maker, amount and any Infra Rewards compensation remain separately unapproved; no entitlement is implied.
  5. Recovery/retention: Approve raw payload, audit, evidence and crosswalk retention; independent durable source journal or redelivery; backup/PITR, restore tests, RPO/RTO, last-safe rollback checkpoint and external-delivery reconciliation. Context housekeeping must not turn stale context into authorization. Authorize final source deletion separately after gates and retention clearance.
  6. Operational acceptance: Build and stage the admin/API/ETL integration; real operators must accept named workflow usability and reconciliation. Confirm system-of-record ownership and signed dependency inventory. SQL tests do not satisfy operator, infrastructure or consumer sign-off.

Proposed gates — not accepted commitments

Proposal Required human evidence
Phase 0, 18 September 2026 Owners/capacity, source and auth contracts, privacy utility and recovery policies
Gate A, 30 October Admin replacement exists; staging workflows can be completed without Airtable
Gate C, 30 November Real monthly close with IA/IR corrections and Trust inputs; operator usability/reconciliation acceptance against baselines
Gate B, 15 December Signed zero-dependency inventory, disabled integration/job credentials, observation window, restore/replay and auth readiness; single authoritative writer
Sunset proposal, 31 December Explicit product-owner deletion authorization, retention clearance, verified gate B; immutable required evidence retained outside Airtable

Dates/capacity must be accepted or rebaselined. A slipping gate needs named owner, impact and revised date; do not waive a failed gate. Before cutover Airtable remains authoritative. After cutover recover PostgreSQL, never silently resume a competing writer. Participant communications/program changes have their own review; this is technical schema review, not broader circulation approval.