Skip to content

Respect ambiguous platform detection in resolveProjectPlatform instead of defaulting to claude-code #91

@LarsCowe

Description

@LarsCowe

Title: Respect ambiguous platform detection in resolveProjectPlatform instead of defaulting to claude-code

Summary

resolveProjectPlatform() still defaults to claude-code when bmalph/config.json is missing and platform detection is ambiguous. detectPlatform() now reports ambiguous root-only markers correctly, but that signal is discarded by the resolver fallback.

Current behavior

In configless projects:

  • .cursor/ correctly resolves to cursor
  • root-only AGENTS.md is treated by detection as ambiguous between codex and cursor
  • root-only CLAUDE.md is treated by detection as ambiguous between claude-code and cursor
  • but resolveProjectPlatform() still returns claude-code whenever detection.detected is null

Relevant code:

  • src/platform/detect.ts
  • src/platform/resolve.ts

Why this matters

This does not block the normal bmalph init --platform cursor -> implement -> run flow because initialized projects have explicit config. It does leave configless edge cases misaligned with the intended Cursor/Codex/Claude detection contract and can produce misleading status/doctor guidance.

Expected behavior

When config is missing and detection is ambiguous, the resolver should not silently default to claude-code.

Possible directions:

  • return an explicit ambiguity result from the resolver and make callers handle it
  • or raise a targeted error/warning telling the user to set the platform explicitly
  • but do not collapse ambiguous detection into claude-code

Acceptance criteria

  • resolveProjectPlatform() does not silently resolve ambiguous root-only markers to claude-code
  • AGENTS.md-only projects are not treated as claude-code
  • CLAUDE.md-only projects are not treated as claude-code unless there is an unambiguous Claude marker
  • caller-facing commands (status, doctor, any other resolver consumers) produce explicit guidance for ambiguous detection paths
  • tests cover the ambiguous detection + resolver behavior end to end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions