Refactor decisionsFix, preserve, refactor, retire

Fix now

Remove ambiguity before structural work.

6 decisions
high risk

Make main/WIP truth explicit

The portfolio branch is substantial and easy to mistake for shipped behavior.

Recommended action

Keep main canonical; expose the branch only in the unmerged WIP lane with commit and divergence.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
README.mdProject Status

Canonical documentation describes portfolio and orders as demo experiences.

SHA-256 · c31120a8404a…
medium risk

Label documentation freshness

A mature-looking document can describe a branch, historical phase, or production-shaped foundation rather than current runtime behavior.

Recommended action

Stamp baseline commit, branch, owner, and status on architectural documents; fail site checks when evidence hashes change.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
README.mdDocumentation

The repository links multiple architecture, workflow, security, and KYC documents.

SHA-256 · c31120a8404a…
high risk

Document three independent configuration axes

Product mode, runtime environment, and backend/identity selection are related but not the same switch.

Recommended action

Show AppExperience, AppRuntimeEnvironment, SocialBackendMode, and IdentityProviderMode separately in every environment review.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/Core/AppExperience.swiftAppExperience

Current product branding/flags/trading environment are compiled independently of backend settings.

SHA-256 · d67d6545ca7c…
Alva Online Trading/Core/Supabase/AppConfiguration.swiftAppConfigurationResolver

Staging and production reject the demo identity provider.

SHA-256 · 5af489cf2329…
high risk

Define data provenance per surface

Live quotes can appear beside mock analysis, portfolio, order, or report data.

Recommended action

Add a data contract and visible debug provenance for every section before backend integration.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailView

The screen coordinates numerous local states, market requests, sections, and protected order actions.

SHA-256 · 4b797479804a…
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockData

A deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.

SHA-256 · 48f2b1220967…
high risk

Establish an app CI floor

A successful local build is useful but does not protect future AI-generated changes.

Recommended action

After CTO approval, add clean build, focused unit tests, and configuration/secret checks as a separate app-CI change; this site PR adds only site checks.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
README.mdVerification

The repository documents build, test, snapshot, simulator, and diff checks.

SHA-256 · c31120a8404a…
critical risk

Remove production secrecy assumptions from RapidAPI

A key bundled in an iOS app can be extracted even when the local configuration file is ignored.

Recommended action

Treat the current key as a client credential with quotas/rotation, or proxy approved requests server-side before production.

OwnerSecurity

Credentials, threat controls, privacy, and release gates.

Source evidence · 2
README.mdSecrets And Configuration

Build settings place approved client configuration into the app while local credential files remain untracked.

SHA-256 · c31120a8404a…
Alva Online Trading/Features/StockDetail/RapidAPIMarketDataAPIClient.swiftRapidAPIMarketDataAPIClient

The iOS client builds authenticated requests to the data provider.

SHA-256 · 39d168db557d…

Preserve

Keep proven seams and safety boundaries intact.

7 decisions
critical risk

Submission is not approval

This is the core financial-safety boundary.

Recommended action

Require tests showing Submitted remains locked in every KYC or portfolio PR.

OwnerLegal / Compliance

KYC policy, consent, approval, and regulated workflows.

Source evidence · 2
Alva Online Trading/Features/KYC/KYCApplication.swiftKYCApplicationStatus.capabilities(in:)

Only approved status unlocks Portfolio and Trading UI; demo approval permits mock orders only.

SHA-256 · f0f22f273b95…
Alva Online Trading SnapshotTests/KYCFoundationTests.swifttestStoreSubmissionRemainsSubmittedAndDoesNotApprove

Tests explicitly prohibit submission from becoming approval.

SHA-256 · f29e6f81b6bb…
critical risk

Fail-closed production configuration

Unsafe identity configuration must not quietly become a demo session.

Recommended action

Keep staging/production demo-provider rejection and the configuration failure screen covered by tests.

OwnerSecurity

Credentials, threat controls, privacy, and release gates.

Source evidence · 2
Alva Online Trading/Core/Supabase/AppConfiguration.swiftAppConfigurationResolver

Staging and production reject the demo identity provider.

SHA-256 · 5af489cf2329…
Alva Online Trading/App/RootView.swiftRootView.routedContent

Authenticated accounts enter AuthenticatedCustomerRoot; all other states remain behind phone entry.

SHA-256 · 2a8c30a43e61…
high risk

AppDependencies composition seam

It already centralizes auth, social, chat, KYC persistence, and KYC providers.

Recommended action

Extend this seam gradually for characterized services instead of introducing parallel globals.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 1
Alva Online Trading/App/AppDependencies.swiftAppDependencies

Shared app services and customer-scoped KYC repository creation are assembled here.

SHA-256 · 93f07042d3aa…
medium risk

Independent value-driven tab paths

Per-tab arrays keep navigation history isolated and make typed destinations reviewable.

Recommended action

Preserve one NavigationStack path per tab and typed AppRoute cases during navigation cleanup.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/App/AppRoute.swiftAppRoute

The route enum is the value-driven navigation contract.

SHA-256 · 55b60b9617c6…
Alva Online Trading/App/ContentView.swiftAppTab.visibleTabs(for:)

IC-Trade resolves to Watchlist, Market, Trade, and Portfolio.

SHA-256 · b7f7769f0d1e…
medium risk

Semantic design tokens

Shared color, typography, spacing, and component semantics support premium consistency and dark/light modes.

Recommended action

Refactor call sites toward existing tokens; do not replace them with screen-local hardcoded styling.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 1
Alva Online Trading/Core/DesignTokens.swiftAppColor / AppFont / AppSpacing

Core semantic tokens centralize visual language.

SHA-256 · 84a7c954e90f…
critical risk

Supabase RLS/RPC ownership boundaries

Authenticated customer ownership and server-side mutations are safety controls, not incidental implementation detail.

Recommended action

Any backend change must retain RLS tests, authenticated ownership derivation, and atomic mutation semantics.

OwnerBackend

Supabase schema, RLS, RPCs, Edge Functions, and operations.

Source evidence · 1
Alva Online Trading/Features/KYC/SupabaseKYCApplicationRepository.swiftSupabaseKYCApplicationRepository

KYC operations are bound to the authenticated customer rather than caller-supplied ownership.

SHA-256 · 63773b3186eb…
medium risk

Deterministic fixtures

Stable KYC, portfolio, and snapshot data make visual and safety regression tests repeatable.

Recommended action

Keep tests/previews offline and synthetic even after production providers are added.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftreferenceDate

Portfolio demo calculations use a fixed Jakarta reference date.

SHA-256 · 48f2b1220967…
Alva Online Trading/Features/KYC/KYCProviderServices.swiftDemoKYCProviderServices

Demo KYC provider behavior is deterministic.

SHA-256 · 71d3508be286…

Refactor after characterization

Lock behavior first, then extract.

7 decisions
high risk

Decompose oversized views

Stock Detail, Search, KYC flow, ContentView, and localization concentrate many independent concerns.

Recommended action

First add route/state/provenance tests, then extract cohesive sections without rewriting behavior.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailView

The screen coordinates numerous local states, market requests, sections, and protected order actions.

SHA-256 · 4b797479804a…
Alva Online Trading/Features/KYC/KYCApplicationStore.swiftKYCApplicationStore

Store operations delegate to a repository and submission contains no approval transition.

SHA-256 · c760b185f1e4…
medium risk

Consolidate localization

Copy is split between AppLocalization helpers, resource files, feature copy structs, and hardcoded strings.

Recommended action

Inventory visible strings and migrate feature-by-feature with English/Indonesian snapshot coverage.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/Features/Notifications/ReportsInboxView.swiftReportNotificationType / ReportNotificationData

Reports include hardcoded visible English copy.

SHA-256 · 291a813930c7…
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockData

Synthetic transaction notes include visible English strings.

SHA-256 · 48f2b1220967…
high risk

Move direct/static dependencies behind seams

Some views instantiate market repositories or read static sample providers directly.

Recommended action

Inject narrow protocols only after tests capture request, cache, fallback, cancellation, and error behavior.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/Features/Watchlist/WatchlistView.swiftWatchlistView

Local AppStorage lists are enriched with live quote and sparkline overlays when available.

SHA-256 · e8387a3585cd…
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailView

The screen coordinates numerous local states, market requests, sections, and protected order actions.

SHA-256 · 4b797479804a…
critical risk

Extract order and portfolio domain state

Canonical main keeps order/portfolio state in views and static samples, which cannot safely support concurrency or persistence.

Recommended action

Use a domain/store/repository boundary; evaluate the WIP branch against explicit invariants rather than copying it wholesale.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 2
Alva Online Trading/App/ContentView.swiftAppTab.visibleTabs(for:)

IC-Trade resolves to Watchlist, Market, Trade, and Portfolio.

SHA-256 · b7f7769f0d1e…
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockData

A deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.

SHA-256 · 48f2b1220967…
high risk

Separate live and mock stock surfaces

Users and engineers can infer false consistency when a screen mixes sources.

Recommended action

Model source/freshness on each section and define atomic presentation snapshots where cross-field consistency matters.

OwnerProduct

User-facing scope, terminology, and accepted demo boundaries.

Source evidence · 1
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailView

The screen coordinates numerous local states, market requests, sections, and protected order actions.

SHA-256 · 4b797479804a…
medium risk

Adopt a production-safe logging policy

Some market failures use print while other configuration paths use OSLog.

Recommended action

Characterize needed diagnostics, redact identifiers/provider detail, and centralize levels/categories.

OwnerSecurity

Credentials, threat controls, privacy, and release gates.

Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftmarket-data error handling

Stock Detail currently prints some RapidAPI failures.

SHA-256 · 4b797479804a…
Alva Online Trading/App/AppDependencies.swiftlogger

Configuration uses a dedicated OSLog category.

SHA-256 · 93f07042d3aa…
high risk

Broaden tests around active trading screens

KYC/auth/forum/symbol foundations are deep, while Trade, Portfolio, reports, and large UI compositions rely more heavily on previews.

Recommended action

Add domain golden tests and focused UI routing tests before replacing sample providers.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading SnapshotTests/KYCFoundationTests.swiftKYCFoundationTests

KYC has extensive state and safety coverage.

SHA-256 · f29e6f81b6bb…
Alva Online Trading/Features/Portfolio/PortfolioView.swiftPortfolioView

Portfolio behavior is currently composed directly from sample models.

SHA-256 · 696809ff8485…

Retire after proof

Delete only after route and test evidence.

4 decisions
medium risk

LegacyRootView

It duplicates routing and local flags but has no observed app entry call site.

Recommended action

Confirm references/previews/tests, preserve routing-policy coverage, then delete in a standalone PR.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 1
Alva Online Trading/App/RootView.swiftLegacyRootView

The legacy private view remains in the file while the App scene constructs RootView.

SHA-256 · 2a8c30a43e61…
high risk

Legacy email-auth paths

The active account entry is unified phone OTP, but historical social/account code may still encode older assumptions.

Recommended action

Search call sites and migrations, add a phone-only account contract test, then remove dead paths incrementally.

OwneriOS

SwiftUI behavior, state ownership, tests, and app quality.

Source evidence · 2
Alva Online Trading/App/AppAuthGateView.swiftAppSignInView

The active sign-in view accepts Indonesian phone and a six-digit OTP.

SHA-256 · f4378357f1b6…
Alva Online Trading/App/RootView.swiftRootView.routedContent

Authenticated accounts enter AuthenticatedCustomerRoot; all other states remain behind phone entry.

SHA-256 · 2a8c30a43e61…
medium risk

Duplicate Market/Search branches

ContentView contains both market and search tab cases even though IC-Trade shows Market and Tradr shows Search.

Recommended action

Retain the shared SearchView, but simplify enum/route cases only after both product modes have navigation tests.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
Alva Online Trading/App/ContentView.swiftAppTab.visibleTabs(for:)

IC-Trade resolves to Watchlist, Market, Trade, and Portfolio.

SHA-256 · b7f7769f0d1e…
high risk

Dormant Tradr/social/chat product branches

They are disabled in IC-Trade but contain tested repository and navigation behavior.

Recommended action

Get a Product decision first; if retired, remove vertical slices with test and migration evidence.

OwnerProduct

User-facing scope, terminology, and accepted demo boundaries.

Source evidence · 3
Alva Online Trading/Core/AppExperience.swiftAppExperience.current

The current app selects IC-Trade while a separate Tradr experience remains defined.

SHA-256 · d67d6545ca7c…
Alva Online Trading/Features/Social/Data/InMemorySocialRepository.swiftInMemorySocialRepository

The default social implementation is session-scoped in memory.

SHA-256 · eeb3b4c9a093…
Alva Online Trading/Features/Chat/InMemoryChatRepository.swiftInMemoryChatRepository

Conversation and message state are seeded and retained in memory.

SHA-256 · 3edbafaf564a…

Do not touch without approval

Require an explicit owner and rollback plan.

7 decisions
critical risk

Signing, capabilities, bundle IDs, and release settings

These can break distribution, security posture, or another developer's local setup.

Recommended action

Change only with explicit release-owner approval and an isolated rollback plan.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
README.mdSecrets And Configuration

Signing and secret overrides are intentionally split into tracked safe defaults and ignored local files.

SHA-256 · c31120a8404a…
high risk

project.pbxproj and Package.resolved

Unnecessary project-file churn creates merge risk and can silently alter targets or dependencies.

Recommended action

Touch only when a reviewed target/file/package change cannot be achieved otherwise; no dependency additions without approval.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 1
README.mdRequirements

The repository has one shared app scheme and explicit local setup.

SHA-256 · c31120a8404a…
critical risk

AppExperience.current

This single selection controls branding, tabs, social visibility, and demo trading semantics.

Recommended action

Treat a mode change as a product release decision with full navigation/KYC regression coverage.

OwnerProduct

User-facing scope, terminology, and accepted demo boundaries.

Source evidence · 1
Alva Online Trading/Core/AppExperience.swiftAppExperience.current

The compiled current experience is IC-Trade.

SHA-256 · d67d6545ca7c…
critical risk

KYC capability semantics

A small boolean change can expose financial UI before authoritative approval.

Recommended action

Require CTO, Security, Compliance, and regression-test approval for capability or transition changes.

OwnerLegal / Compliance

KYC policy, consent, approval, and regulated workflows.

Source evidence · 1
Alva Online Trading/Features/KYC/KYCApplication.swiftKYCApplicationStatus.capabilities(in:)

Only approved status unlocks Portfolio and Trading UI; demo approval permits mock orders only.

SHA-256 · f0f22f273b95…
critical risk

Supabase migrations, RLS, RPCs, and private storage

These changes can expose customer data or corrupt durable state.

Recommended action

Use additive reviewed migrations, database tests, environment backups, and Backend/Security ownership.

OwnerBackend

Supabase schema, RLS, RPCs, Edge Functions, and operations.

Source evidence · 1
Alva Online Trading/Features/KYC/SupabaseKYCApplicationRepository.swiftSupabase KYC boundary

The client relies on authenticated server-side ownership and protected operations.

SHA-256 · 63773b3186eb…
critical risk

Real identity approval

OCR and UI completion are not a regulator-approved decision.

Recommended action

Do not create an approval transition until authoritative review, fraud, audit, and compliance systems are approved.

OwnerLegal / Compliance

KYC policy, consent, approval, and regulated workflows.

Source evidence · 1
docs/kyc/KNOWN_LIMITATIONS.mdApproval limitations

No production reviewer/admin workflow or authoritative approval transition is implemented.

SHA-256 · 7399d212f5b5…
critical risk

Brokerage, exchange, bank, or RDN integration

The current product has no approved live financial-operations infrastructure.

Recommended action

Start a separate architecture/security/compliance program; never connect live money movement through demo view state.

OwnerCTO

Architecture, sequencing, and merge authority.

Source evidence · 2
README.mdProject Status

The repository is a private demo/prototype, not production brokerage infrastructure.

SHA-256 · c31120a8404a…
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockData

A deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.

SHA-256 · 48f2b1220967…