Working in the repo
Trace the change before editing
Start from the route, state owner, data source, and safety boundary. Then make the smallest characterized change that can be reviewed and reversed.
Known-good commands
Set up and verify the app
Each command includes its purpose, expected result, and safety boundary.
- 01
Confirm branch and local work
Verify the intended feature branch and preserve uncommitted work before any edit.
git status --short --branch- Expected
- A non-main branch and only understood changes.
- Safety
- Never discard or overwrite unknown user changes.
- 02
Confirm canonical baseline
Know which main commit the change is based on.
git rev-parse main && git merge-base HEAD main- Expected
- The audit initially points to 262db109; later audits must show their actual commit.
- Safety
- Read-only.
- 03
Inspect Xcode schemes
Confirm schemes/targets before choosing a focused command.
xcodebuild -project 'Alva Online Trading.xcodeproj' -list- Expected
- Shared scheme: Alva Online Trading.
- Safety
- Read-only aside from Xcode caches.
- 04
Build for iPhone 17
Validate app compilation after routing or UI work.
IOS_SCHEME='Alva Online Trading' IOS_DESTINATION='platform=iOS Simulator,name=iPhone 17' ./scripts/verify-ios.sh- Expected
- BUILD SUCCEEDED.
- Safety
- Uses simulator/build artifacts; does not require live production APIs.
- 05
Run focused app tests
Run the repository's configured test action after focused local checks.
IOS_SCHEME='Alva Online Trading' IOS_DESTINATION='platform=iOS Simulator,name=iPhone 17' IOS_ACTION=test ./scripts/verify-ios.sh- Expected
- Relevant unit/snapshot foundation tests pass.
- Safety
- Use deterministic fixtures; never point tests at production.
- 06
Generate deterministic snapshots
Review SwiftUI previews and portfolio snapshot output visually.
./scripts/generate-snapshots.sh- Expected
- Generated files appear only in ignored snapshot-images/.
- Safety
- Mock/sample data only; never commit generated snapshots unless the repository formally adopts baselines.
- 07
Open simulator control
Inspect layout, interaction, Dynamic Type, and dark/light behavior in a booted simulator.
./scripts/serve-sim.sh- Expected
- Local viewer at http://localhost:3200.
- Safety
- Local development only; stop the process when finished.
- 08
Check patch hygiene
Catch whitespace errors and confirm the change remained scoped.
git diff --check && git diff --stat- Expected
- No diff-check errors and an explainable file list.
- Safety
- Read-only.
Before edit
Change checklist
Leave a short proof for every decision that can affect routing, data, KYC, or production configuration.
- 01
Name the behavior and lane
State whether the target is reachable, gated, dormant, legacy, or WIP and which product mode exposes it.
ProofA route/feature-flag citation from ContentView or AppExperience.
- 02
Trace entry and exit
Follow the user action through AppTab/AppRoute/sheet/fullScreenCover and identify back/pop behavior.
ProofA short before/after route trace and one focused navigation test when behavior changes.
- 03
Find the real state owner
Label each value as local @State, parent Binding, owned @StateObject, observed shared object, AppStorage, or repository state.
ProofThe owner and lifetime are written in the PR description.
- 04
Declare provenance and fallback
For every displayed value, identify live/cached/hybrid/mock/simulated source, cache, fallback, freshness, and persistence.
ProofNo UI field is described generically as live when its section is mixed.
- 05
Check capability impact
Run the behavior for Not Started, Submitted, and Approved demo states before touching Trade, Portfolio, Buy/Sell, deposit, or withdrawal.
ProofSubmitted stays locked; Approved demo never calls live financial infrastructure.
- 06
Protect environment boundaries
Confirm product mode, runtime environment, social backend, and identity provider independently.
ProofStaging/production still reject demo identity and configuration failures remain visible.
- 07
Localize and make state accessible
Use the existing English/Indonesian copy structure, non-color status cues, meaningful labels, comfortable targets, and Reduce Motion behavior.
ProofBoth languages and relevant accessibility settings are manually checked.
- 08
Add characterization before refactor
Lock existing calculations, routing, error, empty, loading, and cancellation behavior before extracting architecture.
ProofFocused tests fail on the old bug or guard the preserved behavior.
- 09
Verify the real compact layout
Build and inspect an iPhone 17 simulator in dark/light mode; use deterministic snapshots when the view supports them.
ProofNo clipping, cramped chips/buttons, unsafe-area issue, or hidden interaction state.
- 10
Leave an auditable handoff
Record files, tests, product-code impact, risks, and any stale control-room cards.
ProofThe onboarding generator passes and changed evidence hashes are intentionally refreshed.