HyperOS

mainland.solive

◉Web Properties

✧Cosmos HOS

⌂Mainland OS

🏰Bastion OS

OverviewBastion Instance

🌐Remotica OS

⚙MainOS Kernel

◈XLand

☰Documentation

v9.0.0 — HOS Sovereign OS

4 OS — 12 Districts — 40+ Systems

BASTION INSTANCEPAD/POD REFERENCE

Bastion Instance — PAD/POD Reference Implementation

Source: /Users/lucasaugusto/Documents/sources/Bastion-main/

PAD/POD Lighthouse Architecture

The Bastion instance implements the PAD (Platform Augmenting DATA) and POD (Procedural Operating Device) architecture. PADs define the data structures and schemas that power each entity, while PODs define the operational workflows and procedures that act on that data. Together, they form a “Lighthouse” — a self-contained, illuminated unit that can be deployed independently and guide other instances.

PAD — Platform Augmenting DATA

Data schemas, entity definitions, validation rules, and relationship mappings. The PAD defines WHAT data exists and HOW it is structured. Every entity in the Bastion model has a corresponding PAD definition.

POD — Procedural Operating Device

Workflow definitions, business rules, state machines, and process automation. The POD defines WHAT happens to data and WHEN. Every action in the Bastion system is governed by a POD procedure.

Entity Model — 15 Entities

User

idemailnameroleavatarcreatedAt

Organization

idnametyperegistrationcountrystatus

Person

idfirstNamelastNamephoneemailkycStatus

Endeavor

idtitletypepartiesstatusstartDate

Commitment

idtypeamountcurrencydeadlinestatus

Delivery

idcommitmentIditemsstatustrackingRefdeliveredAt

Payment

idamountcurrencymethodstatuspaidAt

Invoice

idnumberlineItemstotaldueDatestatus

Contract

idtypepartiestermssignedAtexpiresAt

Asset

idtypenamevalueownerIdstatus

Report

idtypeperioddatageneratedAtformat

Approval

identityTypeentityIdapproversstatusdecidedAt

FundingEvent

idtypeamountinvestorsroundclosedAt

AllocationQuota

idresourcelimitusedperiodstatus

AuditLog

idactionentityTypeentityIduserIdtimestamp

Payment Logic: Chronological Fill Algorithm

The Bastion payment system uses a Chronological Fill Algorithm — a FIFO-based payment queue that ensures fair, deterministic settlement of obligations.

1

Invoice Created

A new invoice or commitment generates a payment obligation with a deadline.

2

Queue Entry

The payment enters the chronological queue, ordered by creation timestamp (FIFO).

3

Fund Check

When funds arrive, the system checks the queue from oldest to newest.

4

Partial Fill

If funds are insufficient for full payment, partial allocation is applied and the remainder stays in queue.

5

Complete Fill

When sufficient funds are available, the oldest obligation is fully satisfied and removed from queue.

6

Cascade

Remaining funds cascade to the next obligation in the queue. Process repeats until funds are exhausted.

Technology Stack

React 18

Frontend UI library

Frontend

Vite

Build tool and dev server

Frontend

shadcn/ui

50+ UI components (Card, Table, Dialog, etc.)

Frontend

NestJS

Backend API framework

Backend

GraphQL

API query language and schema

Backend

Prisma

ORM for database access

Backend

Supabase

Auth, realtime, and storage

Infrastructure

PostgreSQL

Primary relational database

Infrastructure

Component Inventory

45+ shadcn/ui components + custom components

AccordionAlertAlertDialogAspectRatioAvatarBadgeBreadcrumbButtonCalendarCardCarouselChartCheckboxCollapsibleCommandContextMenuDialogDrawerDropdownMenuFormHoverCardInputLabelMenubarNavigationMenuPaginationPopoverProgressRadioGroupScrollAreaSelectSeparatorSheetSkeletonSliderSwitchTableTabsTextareaToggleTooltipSonnerInputOTPResizableSidebar

Custom Components

EntityManagerReportGenerationCenterDashboardLayoutDataTableCommitmentTrackerPaymentQueueApprovalWorkflowContractBuilderAssetRegistryAuditTimelineFundingRoundQuotaManager

Architecture Layers

1

Frontend (React)

EntityManagerReportGenerationCenterDashboardFormsTablesCharts
2

API (NestJS/GraphQL)

ResolversGuardsInterceptorsPipesDTOsSubscriptions
3

ORM (Prisma)

SchemaMigrationsSeedClientMiddlewareRelations
4

Database (PostgreSQL)

TablesIndexesViewsFunctionsTriggersRLS Policies
5

Services

Encryption ServiceQueue ServiceCodex ServiceNotification ServiceFile ServiceAnalytics Service