Similar Items: Learning CLI Agents with Structured Action Credit under Selective Observation