feat(daemon): VPN config types and file path helpers [P29.03] - #262
Conversation
- src/vpn-state.ts: vpnDir/activeProfilePath/credentialsPath/vpnManifestPath helpers, VpnManifest read/write, DownloaderNetworkConfig types, validateDownloaderNetwork - src/auth-state.ts: extend NetworkPostureState with vpn_bridge_active; include in readNetworkPosture guard and acknowledgeNetworkPosture signature - src/config.ts: add downloaderNetwork?: DownloaderNetworkConfig to AppConfig; validate via validateOptionalDownloaderNetwork
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR introduces VPN configuration and state management to the application. It adds a new Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config.ts`:
- Around line 184-186: The current check treats explicit null as absent by
returning undefined; change the early-return to only treat undefined as absent
so null flows into validation: replace the condition that checks both undefined
and null with a check for undefined only, letting
validateDownloaderNetwork(input) receive null and fail fast (or update
validateDownloaderNetwork to explicitly reject null) — key symbols: the input
parameter in this block and validateDownloaderNetwork.
In `@src/vpn-state.ts`:
- Around line 92-123: The parser currently casts raw to obj and only validates
known fields but ignores extra keys; update the validation in the function
handling downloaderNetwork (where raw/obj are used and
VALID_MODES/VALID_STATUSES and DownloaderNetworkConfig are referenced) to reject
unknown keys: compute Object.keys(obj), allow only the set
["mode","provider","profile","status"], and if any other keys exist throw a
ConfigError listing the unexpected keys so typos or extra config entries fail
fast instead of being dropped silently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 9116f1c3-b062-4787-800d-b89b8a36ff77
📒 Files selected for processing (5)
docs/product/delivery/phase-29/ticket-03-vpn-config-types-and-file-paths.mdsrc/auth-state.tssrc/config.tssrc/vpn-state.tstest/vpn-state.test.ts
- src/config.ts: null downloaderNetwork now flows to validateDownloaderNetwork and fails fast instead of silently returning undefined - src/vpn-state.ts: validateDownloaderNetwork rejects unknown keys with ConfigError to prevent silent misconfiguration - test/vpn-state.test.ts: add unknown-key rejection test - test/config.test.ts: add null, absent, unknown-key, and valid downloaderNetwork tests - .prettierignore.root: exclude .son-of-anton/.agents/ review artifacts from prettier
Summary
P29.03 VPN Config Types and File Path Helpersagents/p29-02-p28-carry-over-prerequisitesExternal AI Review
patchedc35e151dc7437a273e032769c35e151dc743address all findings from that review.coderabbit,qodoResolved Review Findings
nullas “absent” fordownloaderNetwork. (native GitHub thread resolved)src/config.ts:186threaddownloaderNetworkto prevent silent misconfiguration. (native GitHub thread resolved)src/vpn-state.ts:123threadNo-Action Rationale