Skip to content

Migrate load_hints() to .dual/settings.json + devcontainer merge #146

@jeevanpillay

Description

@jeevanpillay

Summary

Update load_hints() in src/config.rs to read from .dual/settings.json instead of .dual.toml. The merge logic (DualConfig + devcontainer.json → RepoHints) stays the same, but the source file and format change.

Changes

load_hints()

1. Read `.dual/settings.json` → DualConfig (JSON)
2. Read devcontainer.json at the path specified in DualConfig.devcontainer
3. Parse devcontainer.json → RepoHints via to_repo_hints()
4. Merge DualConfig fields + devcontainer RepoHints → final RepoHints

Key difference from current: devcontainer path is always explicit (required field), no auto-detection fallback.

load_dual_config()

  • Read from .dual/settings.json using serde_json
  • Return error if file doesn't exist (not defaults — user must dual init)

Remove/update

  • Remove check_deprecated_fields() (TOML-specific)
  • Remove resolve_devcontainer_path() auto-detection (path is always explicit)
  • Remove write_default_dual_config() (replaced by init wizard)
  • Remove write_default_devcontainer() (replaced by init wizard)
  • Update write_dual_config() to write JSON
  • Update parse_dual_config() to parse JSON

SharedConfig simplification

Current: shared: Option<SharedConfig> where SharedConfig { files: Vec<String> }
New: shared: Vec<String> (flat list)

Update all consumers of hints.shared (main.rs cmd_launch, cmd_sync, cmd_add/init).

Tests

  • load_hints() reads from .dual/settings.json
  • Missing .dual/settings.json returns error
  • Merge logic unchanged
  • SharedConfig consumers updated

Metadata

Metadata

Assignees

Labels

coreCore functionality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions