Refactor decisions
Choose the next change with evidence
This is decision support, not an automatic deletion list. The CTO remains the final owner of architecture, migration, and retirement choices.
Fix now
Remove ambiguity before structural work.
Make main/WIP truth explicit
The portfolio branch is substantial and easy to mistake for shipped behavior.
Keep main canonical; expose the branch only in the unmerged WIP lane with commit and divergence.
Architecture, sequencing, and merge authority.
Source evidence · 1
README.mdProject StatusCanonical documentation describes portfolio and orders as demo experiences.
SHA-256 · c31120a8404a…Label documentation freshness
A mature-looking document can describe a branch, historical phase, or production-shaped foundation rather than current runtime behavior.
Stamp baseline commit, branch, owner, and status on architectural documents; fail site checks when evidence hashes change.
Architecture, sequencing, and merge authority.
Source evidence · 1
README.mdDocumentationThe repository links multiple architecture, workflow, security, and KYC documents.
SHA-256 · c31120a8404a…Document three independent configuration axes
Product mode, runtime environment, and backend/identity selection are related but not the same switch.
Show AppExperience, AppRuntimeEnvironment, SocialBackendMode, and IdentityProviderMode separately in every environment review.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/Core/AppExperience.swiftAppExperienceCurrent product branding/flags/trading environment are compiled independently of backend settings.
SHA-256 · d67d6545ca7c…Alva Online Trading/Core/Supabase/AppConfiguration.swiftAppConfigurationResolverStaging and production reject the demo identity provider.
SHA-256 · 5af489cf2329…Define data provenance per surface
Live quotes can appear beside mock analysis, portfolio, order, or report data.
Add a data contract and visible debug provenance for every section before backend integration.
Architecture, sequencing, and merge authority.
Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailViewThe screen coordinates numerous local states, market requests, sections, and protected order actions.
SHA-256 · 4b797479804a…Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockDataA deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.
SHA-256 · 48f2b1220967…Establish an app CI floor
A successful local build is useful but does not protect future AI-generated changes.
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.
Architecture, sequencing, and merge authority.
Source evidence · 1
README.mdVerificationThe repository documents build, test, snapshot, simulator, and diff checks.
SHA-256 · c31120a8404a…Remove production secrecy assumptions from RapidAPI
A key bundled in an iOS app can be extracted even when the local configuration file is ignored.
Treat the current key as a client credential with quotas/rotation, or proxy approved requests server-side before production.
Credentials, threat controls, privacy, and release gates.
Source evidence · 2
README.mdSecrets And ConfigurationBuild settings place approved client configuration into the app while local credential files remain untracked.
SHA-256 · c31120a8404a…Alva Online Trading/Features/StockDetail/RapidAPIMarketDataAPIClient.swiftRapidAPIMarketDataAPIClientThe iOS client builds authenticated requests to the data provider.
SHA-256 · 39d168db557d…Preserve
Keep proven seams and safety boundaries intact.
Submission is not approval
This is the core financial-safety boundary.
Require tests showing Submitted remains locked in every KYC or portfolio PR.
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.swifttestStoreSubmissionRemainsSubmittedAndDoesNotApproveTests explicitly prohibit submission from becoming approval.
SHA-256 · f29e6f81b6bb…Fail-closed production configuration
Unsafe identity configuration must not quietly become a demo session.
Keep staging/production demo-provider rejection and the configuration failure screen covered by tests.
Credentials, threat controls, privacy, and release gates.
Source evidence · 2
Alva Online Trading/Core/Supabase/AppConfiguration.swiftAppConfigurationResolverStaging and production reject the demo identity provider.
SHA-256 · 5af489cf2329…Alva Online Trading/App/RootView.swiftRootView.routedContentAuthenticated accounts enter AuthenticatedCustomerRoot; all other states remain behind phone entry.
SHA-256 · 2a8c30a43e61…AppDependencies composition seam
It already centralizes auth, social, chat, KYC persistence, and KYC providers.
Extend this seam gradually for characterized services instead of introducing parallel globals.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 1
Alva Online Trading/App/AppDependencies.swiftAppDependenciesShared app services and customer-scoped KYC repository creation are assembled here.
SHA-256 · 93f07042d3aa…Independent value-driven tab paths
Per-tab arrays keep navigation history isolated and make typed destinations reviewable.
Preserve one NavigationStack path per tab and typed AppRoute cases during navigation cleanup.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/App/AppRoute.swiftAppRouteThe 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…Semantic design tokens
Shared color, typography, spacing, and component semantics support premium consistency and dark/light modes.
Refactor call sites toward existing tokens; do not replace them with screen-local hardcoded styling.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 1
Alva Online Trading/Core/DesignTokens.swiftAppColor / AppFont / AppSpacingCore semantic tokens centralize visual language.
SHA-256 · 84a7c954e90f…Supabase RLS/RPC ownership boundaries
Authenticated customer ownership and server-side mutations are safety controls, not incidental implementation detail.
Any backend change must retain RLS tests, authenticated ownership derivation, and atomic mutation semantics.
Supabase schema, RLS, RPCs, Edge Functions, and operations.
Source evidence · 1
Alva Online Trading/Features/KYC/SupabaseKYCApplicationRepository.swiftSupabaseKYCApplicationRepositoryKYC operations are bound to the authenticated customer rather than caller-supplied ownership.
SHA-256 · 63773b3186eb…Deterministic fixtures
Stable KYC, portfolio, and snapshot data make visual and safety regression tests repeatable.
Keep tests/previews offline and synthetic even after production providers are added.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftreferenceDatePortfolio demo calculations use a fixed Jakarta reference date.
SHA-256 · 48f2b1220967…Alva Online Trading/Features/KYC/KYCProviderServices.swiftDemoKYCProviderServicesDemo KYC provider behavior is deterministic.
SHA-256 · 71d3508be286…Refactor after characterization
Lock behavior first, then extract.
Decompose oversized views
Stock Detail, Search, KYC flow, ContentView, and localization concentrate many independent concerns.
First add route/state/provenance tests, then extract cohesive sections without rewriting behavior.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailViewThe screen coordinates numerous local states, market requests, sections, and protected order actions.
SHA-256 · 4b797479804a…Alva Online Trading/Features/KYC/KYCApplicationStore.swiftKYCApplicationStoreStore operations delegate to a repository and submission contains no approval transition.
SHA-256 · c760b185f1e4…Consolidate localization
Copy is split between AppLocalization helpers, resource files, feature copy structs, and hardcoded strings.
Inventory visible strings and migrate feature-by-feature with English/Indonesian snapshot coverage.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/Features/Notifications/ReportsInboxView.swiftReportNotificationType / ReportNotificationDataReports include hardcoded visible English copy.
SHA-256 · 291a813930c7…Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockDataSynthetic transaction notes include visible English strings.
SHA-256 · 48f2b1220967…Move direct/static dependencies behind seams
Some views instantiate market repositories or read static sample providers directly.
Inject narrow protocols only after tests capture request, cache, fallback, cancellation, and error behavior.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/Features/Watchlist/WatchlistView.swiftWatchlistViewLocal AppStorage lists are enriched with live quote and sparkline overlays when available.
SHA-256 · e8387a3585cd…Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailViewThe screen coordinates numerous local states, market requests, sections, and protected order actions.
SHA-256 · 4b797479804a…Extract order and portfolio domain state
Canonical main keeps order/portfolio state in views and static samples, which cannot safely support concurrency or persistence.
Use a domain/store/repository boundary; evaluate the WIP branch against explicit invariants rather than copying it wholesale.
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.swiftPortfolioMockDataA deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.
SHA-256 · 48f2b1220967…Separate live and mock stock surfaces
Users and engineers can infer false consistency when a screen mixes sources.
Model source/freshness on each section and define atomic presentation snapshots where cross-field consistency matters.
User-facing scope, terminology, and accepted demo boundaries.
Source evidence · 1
Alva Online Trading/Features/StockDetail/StockDetailView.swiftStockDetailViewThe screen coordinates numerous local states, market requests, sections, and protected order actions.
SHA-256 · 4b797479804a…Adopt a production-safe logging policy
Some market failures use print while other configuration paths use OSLog.
Characterize needed diagnostics, redact identifiers/provider detail, and centralize levels/categories.
Credentials, threat controls, privacy, and release gates.
Source evidence · 2
Alva Online Trading/Features/StockDetail/StockDetailView.swiftmarket-data error handlingStock Detail currently prints some RapidAPI failures.
SHA-256 · 4b797479804a…Alva Online Trading/App/AppDependencies.swiftloggerConfiguration uses a dedicated OSLog category.
SHA-256 · 93f07042d3aa…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.
Add domain golden tests and focused UI routing tests before replacing sample providers.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading SnapshotTests/KYCFoundationTests.swiftKYCFoundationTestsKYC has extensive state and safety coverage.
SHA-256 · f29e6f81b6bb…Alva Online Trading/Features/Portfolio/PortfolioView.swiftPortfolioViewPortfolio behavior is currently composed directly from sample models.
SHA-256 · 696809ff8485…Retire after proof
Delete only after route and test evidence.
LegacyRootView
It duplicates routing and local flags but has no observed app entry call site.
Confirm references/previews/tests, preserve routing-policy coverage, then delete in a standalone PR.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 1
Alva Online Trading/App/RootView.swiftLegacyRootViewThe legacy private view remains in the file while the App scene constructs RootView.
SHA-256 · 2a8c30a43e61…Legacy email-auth paths
The active account entry is unified phone OTP, but historical social/account code may still encode older assumptions.
Search call sites and migrations, add a phone-only account contract test, then remove dead paths incrementally.
SwiftUI behavior, state ownership, tests, and app quality.
Source evidence · 2
Alva Online Trading/App/AppAuthGateView.swiftAppSignInViewThe active sign-in view accepts Indonesian phone and a six-digit OTP.
SHA-256 · f4378357f1b6…Alva Online Trading/App/RootView.swiftRootView.routedContentAuthenticated accounts enter AuthenticatedCustomerRoot; all other states remain behind phone entry.
SHA-256 · 2a8c30a43e61…Duplicate Market/Search branches
ContentView contains both market and search tab cases even though IC-Trade shows Market and Tradr shows Search.
Retain the shared SearchView, but simplify enum/route cases only after both product modes have navigation tests.
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…Dormant Tradr/social/chat product branches
They are disabled in IC-Trade but contain tested repository and navigation behavior.
Get a Product decision first; if retired, remove vertical slices with test and migration evidence.
User-facing scope, terminology, and accepted demo boundaries.
Source evidence · 3
Alva Online Trading/Core/AppExperience.swiftAppExperience.currentThe current app selects IC-Trade while a separate Tradr experience remains defined.
SHA-256 · d67d6545ca7c…Alva Online Trading/Features/Social/Data/InMemorySocialRepository.swiftInMemorySocialRepositoryThe default social implementation is session-scoped in memory.
SHA-256 · eeb3b4c9a093…Alva Online Trading/Features/Chat/InMemoryChatRepository.swiftInMemoryChatRepositoryConversation and message state are seeded and retained in memory.
SHA-256 · 3edbafaf564a…Do not touch without approval
Require an explicit owner and rollback plan.
Signing, capabilities, bundle IDs, and release settings
These can break distribution, security posture, or another developer's local setup.
Change only with explicit release-owner approval and an isolated rollback plan.
Architecture, sequencing, and merge authority.
Source evidence · 1
README.mdSecrets And ConfigurationSigning and secret overrides are intentionally split into tracked safe defaults and ignored local files.
SHA-256 · c31120a8404a…project.pbxproj and Package.resolved
Unnecessary project-file churn creates merge risk and can silently alter targets or dependencies.
Touch only when a reviewed target/file/package change cannot be achieved otherwise; no dependency additions without approval.
Architecture, sequencing, and merge authority.
Source evidence · 1
README.mdRequirementsThe repository has one shared app scheme and explicit local setup.
SHA-256 · c31120a8404a…AppExperience.current
This single selection controls branding, tabs, social visibility, and demo trading semantics.
Treat a mode change as a product release decision with full navigation/KYC regression coverage.
User-facing scope, terminology, and accepted demo boundaries.
Source evidence · 1
Alva Online Trading/Core/AppExperience.swiftAppExperience.currentThe compiled current experience is IC-Trade.
SHA-256 · d67d6545ca7c…KYC capability semantics
A small boolean change can expose financial UI before authoritative approval.
Require CTO, Security, Compliance, and regression-test approval for capability or transition changes.
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…Supabase migrations, RLS, RPCs, and private storage
These changes can expose customer data or corrupt durable state.
Use additive reviewed migrations, database tests, environment backups, and Backend/Security ownership.
Supabase schema, RLS, RPCs, Edge Functions, and operations.
Source evidence · 1
Alva Online Trading/Features/KYC/SupabaseKYCApplicationRepository.swiftSupabase KYC boundaryThe client relies on authenticated server-side ownership and protected operations.
SHA-256 · 63773b3186eb…Real identity approval
OCR and UI completion are not a regulator-approved decision.
Do not create an approval transition until authoritative review, fraud, audit, and compliance systems are approved.
KYC policy, consent, approval, and regulated workflows.
Source evidence · 1
docs/kyc/KNOWN_LIMITATIONS.mdApproval limitationsNo production reviewer/admin workflow or authoritative approval transition is implemented.
SHA-256 · 7399d212f5b5…Brokerage, exchange, bank, or RDN integration
The current product has no approved live financial-operations infrastructure.
Start a separate architecture/security/compliance program; never connect live money movement through demo view state.
Architecture, sequencing, and merge authority.
Source evidence · 2
README.mdProject StatusThe repository is a private demo/prototype, not production brokerage infrastructure.
SHA-256 · c31120a8404a…Alva Online Trading/Features/Portfolio/PortfolioMockData.swiftPortfolioMockDataA deterministic synthetic ledger derives holdings, balance, history, fees, and P&L.
SHA-256 · 48f2b1220967…